GrafanaAdapters: Added Round function - changed Random function abbreviation to Rand instead of Rnd for clarity

--- Source/Libraries/Adapters/GrafanaAdapters/GrafanaDataSourceBase.cs
+++ Source/Libraries/Adapters/GrafanaAdapters/GrafanaDataSourceBase.cs
@@ -111,6 +111,15 @@
         /// </remarks>
         AbsoluteValue,
         ///
+        /// Returns a series of values that represent the rounded value, with N fractional digits, of each of the values in the source series.
+        /// N, optional, is a positive integer value representing the number of decimal places in the return value - defaults to 0.
+        ///
+        /// <remarks>
+        /// Example: <c>Round(3, FILTER ActiveMeasurements WHERE SignalType='FREQ')</c>

+        /// Variants: Round
+        /// </remarks>
+        Round,
+        ///
         /// Returns a single value that represents the standard deviation of the values in the source series.
         ///
         /// <remarks>
@@ -169,7 +178,7 @@
         ///
         /// <remarks>
         /// Example: <c>Random(25%, FILTER ActiveMeasurements WHERE SignalType='VPHM')</c>

-        /// Variants: Random, Rnd, Sample
+        /// Variants: Random, Rand, Sample
         /// </remarks>
         Random,
         ///
@@ -596,6 +605,15 @@

                         for (int i = 0; i < currentSeries.Length; i++)
                             result.datapoints.Add(new[] { Math.Abs(currentSeries[i]), currentTimes[i] });
+
+                        break;
+                    case SeriesFunction.Round:
+                        currentSeries = values.ToArray();
+                        currentTimes = times.ToArray();
+                        count = parameters.Length == 0 ? 0 : ParseInt(parameters[0]);
+
+                        for (int i = 0; i < currentSeries.Length; i++)
+                            result.datapoints.Add(new[] { Math.Round(currentSeries[i], count), currentTimes[i] });

                         break;
                     case SeriesFunction.StandardDeviation:
@@ -731,7 +749,7 @@
                         result.datapoints.Add(new[] { integratedValue, times.Max() });
                         break;
                     case SeriesFunction.Interval:
-                        value = ParseValue(parameters[0]) / SI.Milli;
+                        value = ParseFloat(parameters[0]) / SI.Milli;
                         currentSeries = values.ToArray();
                         currentTimes = times.ToArray();
                         double lastTime = 0.0D;
@@ -816,6 +834,10 @@
                             break;
                         case SeriesFunction.AbsoluteValue:
                             result.datapoints.AddRange(series.datapoints.Select(point => new[] { Math.Abs(point[TimeSeriesValues.Value]), point[TimeSeriesValues.Time] }));
+                            break;
+                        case SeriesFunction.Round:
+                            count = parameters.Length == 0 ? 0 : ParseInt(parameters[0]);
+                            result.datapoints.AddRange(series.datapoints.Select(point => new[] { Math.Round(point[TimeSeriesValues.Value], count), point[TimeSeriesValues.Time] }));
                             break;
                         case SeriesFunction.StandardDeviation:
                             result.datapoints.Add(new[] { values.StandardDeviation(), lastTime });
@@ -925,7 +947,7 @@
                             result.datapoints.Add(new[] { integratedValue, lastTime });
                             break;
                         case SeriesFunction.Interval:
-                            value = ParseValue(parameters[0]) / SI.Milli;
+                            value = ParseFloat(parameters[0]) / SI.Milli;
                             lastTime = 0.0D;

                             for (int i = 0; i < series.datapoints.Count; i++)
@@ -959,6 +981,7 @@
         private static readonly Regex s_countExpression;
         private static readonly Regex s_distinctExpression;
         private static readonly Regex s_absoluteValueExpression;
+        private static readonly Regex s_roundExpression;
         private static readonly Regex s_standardDeviationExpression;
         private static readonly Regex s_standardDeviationSampleExpression;
         private static readonly Regex s_medianExpression;
@@ -994,13 +1017,14 @@
             s_countExpression = new Regex(string.Format(GetExpression, "Count"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_distinctExpression = new Regex(string.Format(GetExpression, "(Distinct|Unique)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_absoluteValueExpression = new Regex(string.Format(GetExpression, "(AbsoluteValue|Abs)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
+            s_roundExpression = new Regex(string.Format(GetExpression, "Round"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_standardDeviationExpression = new Regex(string.Format(GetExpression, "(StandardDeviation|StdDev)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_standardDeviationSampleExpression = new Regex(string.Format(GetExpression, "(StandardDeviationSample|StdDevSamp)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_medianExpression = new Regex(string.Format(GetExpression, "(Median|Med|Mid)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_modeExpression = new Regex(string.Format(GetExpression, "Mode"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_topExpression = new Regex(string.Format(GetExpression, "Top"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_bottomExpression = new Regex(string.Format(GetExpression, "(Bottom|Bot)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
-            s_randomExpression = new Regex(string.Format(GetExpression, "(Random|Rnd|Sample)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
+            s_randomExpression = new Regex(string.Format(GetExpression, "(Random|Rand|Sample)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_firstExpression = new Regex(string.Format(GetExpression, "First"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_lastExpression = new Regex(string.Format(GetExpression, "Last"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
             s_percentileExpression = new Regex(string.Format(GetExpression, "(Percentile|Pctl)"), RegexOptions.Compiled | RegexOptions.IgnoreCase);
@@ -1021,6 +1045,7 @@
                 [SeriesFunction.Count] = 0,
                 [SeriesFunction.Distinct] = 0,
                 [SeriesFunction.AbsoluteValue] = 0,
+                [SeriesFunction.Round] = 0,
                 [SeriesFunction.StandardDeviation] = 0,
                 [SeriesFunction.StandardDeviationSample] = 0,
                 [SeriesFunction.Median] = 0,
@@ -1050,6 +1075,7 @@
                 [SeriesFunction.Count] = 0,
                 [SeriesFunction.Distinct] = 0,
                 [SeriesFunction.AbsoluteValue] = 0,
+                [SeriesFunction.Round] = 1,
                 [SeriesFunction.StandardDeviation] = 0,
                 [SeriesFunction.StandardDeviationSample] = 0,
                 [SeriesFunction.Median] = 0,
@@ -1133,6 +1159,13 @@
                 if (filterMatch.Success)
                     return new Tuple<SeriesFunction, string, bool>(SeriesFunction.AbsoluteValue, filterMatch.Result("${Expression}").Trim(), setOperation);

+                // Look for round function
+                lock (s_roundExpression)
+                    filterMatch = s_roundExpression.Match(expression);
+
+                if (filterMatch.Success)
+                    return new Tuple<SeriesFunction, string, bool>(SeriesFunction.Round, filterMatch.Result("${Expression}").Trim(), setOperation);
+
                 // Look for standard deviation function
                 lock (s_standardDeviationExpression)
                     filterMatch = s_standardDeviationExpression.Match(expression);
@@ -1248,6 +1281,52 @@
             return result;
         }

+        private static int ParseInt(string parameter, bool includeZero = true)
+        {
+            int value;
+
+            parameter = parameter.Trim();
+
+            if (!int.TryParse(parameter, out value))
+                throw new FormatException($"Could not parse '{parameter}' as an integer value.");
+
+            if (includeZero)
+            {
+                if (value < 0)
+                    throw new ArgumentOutOfRangeException($"Value '{parameter}' is less than zero.");
+            }
+            else
+            {
+                if (value <= 0)
+                    throw new ArgumentOutOfRangeException($"Value '{parameter}' is less than or equal to zero.");
+            }
+
+            return value;
+        }
+
+        private static double ParseFloat(string parameter, bool includeZero = false)
+        {
+            double value;
+
+            parameter = parameter.Trim();
+
+            if (!double.TryParse(parameter, out value))
+                throw new FormatException($"Could not parse '{parameter}' as a floating-point value.");
+
+            if (includeZero)
+            {
+                if (value < 0.0D)
+                    throw new ArgumentOutOfRangeException($"Value '{parameter}' is less than zero.");
+            }
+            else
+            {
+                if (value <= 0.0D)
+                    throw new ArgumentOutOfRangeException($"Value '{parameter}' is less than or equal to zero.");
+            }
+
+            return value;
+        }
+
         private static int ParseCount(string parameter, int length)
         {
             int count;
@@ -1272,29 +1351,6 @@
             return count;
         }

-        private static double ParseValue(string parameter, bool includeZero = false)
-        {
-            double value;
-
-            parameter = parameter.Trim();
-
-            if (!double.TryParse(parameter, out value))
-                throw new FormatException($"Could not parse '{parameter}' as a floating-point value.");
-
-            if (includeZero)
-            {
-                if (value < 0.0D)
-                    throw new ArgumentOutOfRangeException($"Value '{parameter}' is less than zero.");
-            }
-            else
-            {
-                if (value <= 0.0D)
-                    throw new ArgumentOutOfRangeException($"Value '{parameter}' is less than or equal to zero.");
-            }
-
-            return value;
-        }
-
         private static double ParsePercentage(string parameter, bool includeZero = true)
         {
             double percent;


Ensure onloaded scripts are injected after onloading are finished

--- Ao3TrackReader/Ao3TrackReader/WebViewPage.xaml.cs
+++ Ao3TrackReader/Ao3TrackReader/WebViewPage.xaml.cs
@@ -1488,7 +1488,9 @@
             return false;
         }

-        async void OnContentLoading()
+        Task loadingTask = null;
+
+        void OnContentLoading()
         {
             if (startPage != null)
             {
@@ -1500,13 +1502,16 @@
             System.Diagnostics.Debug.WriteLine("{0}: OnContentLoading", System.Diagnostics.Stopwatch.GetTimestamp());
             helper?.Reset();

-            CancellationToken ct = new CancellationToken(false);
             if (!isErrorPage)
             {
-                foreach (var injection in InjectionsLoading)
-                {
-                    await InjectScript(injection, ct);
-                }
+                loadingTask = DoOnMainThreadAsync(async () =>
+                {
+                    CancellationToken ct = new CancellationToken(false);
+                    foreach (var injection in InjectionsLoading)
+                    {
+                        await InjectScript(injection, ct);
+                    }
+                });
             }
         }

@@ -1566,6 +1571,8 @@

         async void InjectScripts()
         {
+            if (loadingTask != null) await loadingTask;
+
             try
             {
                 cancelInject?.Cancel();


fixed issue with new isBinary param to write method

--- src/wp/File.cs
+++ src/wp/File.cs
@@ -788,7 +788,8 @@
             string filePath = optStrings[0];
             string data = optStrings[1];
             int position = int.Parse(optStrings[2]);
-            string callbackId = optStrings[3];
+            bool isBinary = bool.Parse(optStrings[3]);
+            string callbackId = optStrings[4];

             try
             {


Fix compile error with namespace conflict

--- Assets/Alensia/Core/UI/Legacy/CursorDefinition.cs
+++ Assets/Alensia/Core/UI/Legacy/CursorDefinition.cs
@@ -16,10 +16,10 @@

         public void Apply()
         {
-            Cursor.visible = Visible;
-            Cursor.lockState = LockMode;
+            UnityEngine.Cursor.visible = Visible;
+            UnityEngine.Cursor.lockState = LockMode;

-            Cursor.SetCursor(Image, Hotspot, CursorMode.Auto);
+            UnityEngine.Cursor.SetCursor(Image, Hotspot, CursorMode.Auto);
         }

         public static CursorDefinition Hidden = new CursorDefinition


Added check for empty string value.

Added check for empty string value.

--- Src/Our.Umbraco.Mortar/Web/PropertyEditors/MortarPropertyEditor.cs
+++ Src/Our.Umbraco.Mortar/Web/PropertyEditors/MortarPropertyEditor.cs
@@ -165,7 +165,7 @@

 			public override object ConvertDbToEditor(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
 			{
-				if (property.Value == null)
+				if (property.Value == null || string.IsNullOrWhiteSpace(property.Value.ToString()))
 					return string.Empty;

 				var value = JsonConvert.DeserializeObject<MortarValue>(property.Value.ToString());


Fix popping of stars when changing locations


 * Increased granularity of buffer locks (should help multi-source playing perf)

git-svn-id: e2945e6dc2723cb01f425b5a7c3c201ce5019a89@348 080cfd25-d5d9-4c59-82ea-70d02a200d8b

--- Gablarski/Audio/OpenAL/Providers/OpenALPlaybackProvider.cs
+++ Gablarski/Audio/OpenAL/Providers/OpenALPlaybackProvider.cs
@@ -54,19 +54,20 @@
 			if (data.Length == 0)
 				return;

+			Stack<SourceBuffer> bufferStack;
 			SourceBuffer buffer;
 			lock (bufferLock)
 			{
-				if (!this.buffers.ContainsKey (audioSource))
-				{
-					this.buffers[audioSource] = new Stack<SourceBuffer> ();
-					this.PushBuffers (audioSource, 10);
-				}
+				if (!this.buffers.TryGetValue (audioSource, out bufferStack))
+					this.buffers[audioSource] = bufferStack = new Stack<SourceBuffer>();
+			}

-				if (this.buffers[audioSource].Count == 0)
-					this.PushBuffers (audioSource, 10);
+			lock (bufferStack)
+			{
+				if (bufferStack.Count == 0)
+					PushBuffers (bufferStack, 10);

-				buffer = this.buffers[audioSource].Pop ();
+				buffer = bufferStack.Pop ();
 			}

 			//var buffer = SourceBuffer.Generate ();
@@ -102,11 +103,11 @@
 		private readonly object bufferLock = new object ();
 		private readonly Dictionary<AudioSource, Stack<SourceBuffer>> buffers = new Dictionary<AudioSource, Stack<SourceBuffer>> ();

-		private void PushBuffers (AudioSource audioSource, int number)
+		private static void PushBuffers (Stack<SourceBuffer> bufferStack, int number)
 		{
 			SourceBuffer[] sbuffers = SourceBuffer.Generate (number);
 			for (int i = 0; i < sbuffers.Length; ++i)
-				this.buffers[audioSource].Push (sbuffers[i]);
+				bufferStack.Push (sbuffers[i]);
 		}

 		private void OnSourceFinished (SourceFinishedEventArgs e)


remove old segmentwalk that wasn't in use

--- Bend/LayerManager/RootMetadata/RangemapManager.cs
+++ Bend/LayerManager/RootMetadata/RangemapManager.cs
@@ -223,17 +223,6 @@

         // ------------[ public segmentWalkForKey ] --------------

-        public RecordUpdateResult segmentWalkForKey_OLD(
-            RecordKey key,
-            ISortedSegment curseg,
-            ref RecordData record) {
-
-            HashSet<int> handledGenerations = new HashSet<int>();
-            return this.INTERNAL_segmentWalkForKey_OLD(
-                key, curseg, handledGenerations, num_generations, ref record);
-
-
-        }

         public GetStatus getNextRecord(IComparable<RecordKey> lowkey, ref RecordKey key, ref RecordData record,
             bool equal_ok) {
@@ -503,83 +492,6 @@

-        // ------------[ ** INTERNAL ** segmentWalkForKey ]-------
-        //
-        // This is the meaty internal function that does the "magic"
-        // of the segment walk.
-
-        private RecordUpdateResult INTERNAL_segmentWalkForKey_OLD(
-            RecordKey key,
-            ISortedSegment curseg,
-            HashSet<int> handledGenerations,
-            int maxgen,
-            ref RecordData record) {
-
-            // first look in this segment for the key
-            {
-                RecordUpdate update;
-                if (curseg.getRecordUpdate(key, out update) == GetStatus.PRESENT) {
-                    if (record.applyUpdate(update) == RecordUpdateResult.FINAL) {
-                        return RecordUpdateResult.FINAL;
-                    }
-                }
-            }
-
-            // make a note of which generation range references have precedence in this segment
-            HashSet<int> nextHandledGenerations = new HashSet<int>(handledGenerations);
-            for (int i = maxgen; i >= 0; i--) {
-                RecordKey rangekey = new RecordKey().appendParsedKey(".ROOT/GEN")
-                    .appendKeyPart(Lsd.numberToLsd(i,GEN_LSD_PAD)).appendParsedKey("</>");
-                RecordUpdate update;
-
-                RangeKey trangekey = RangeKey.newSegmentRangeKey(
-                   new RecordKey().appendParsedKey("<"),
-                   new RecordKey().appendParsedKey(">"), i);
-                if ((!trangekey.toRecordKey().Equals(rangekey))) {
-                    throw new Exception(String.Format("RangeKey({0}) differs from RecordKey({1})", trangekey.toRecordKey(), rangekey));
-                }
-
-                // TODO: make a "getRecordExists()" call in ISortedSegment to make this more efficient
-                //  .. then make sure we use that optimization to avoid calling getRecordUpdate on those
-                //  .. entries in the next loop below.
-                if (curseg.getRecordUpdate(rangekey,out update) == GetStatus.PRESENT) {
-                    nextHandledGenerations.Add(i);  // mark the generation handled at this level
-                }
-            }
-
-            // now repeat the walk of range references in this segment, this time actually descending
-            for (int i = maxgen; i >= 0; i--) {
-
-                RecordKey rangekey = new RecordKey().appendParsedKey(".ROOT/GEN")
-                    .appendKeyPart(Lsd.numberToLsd(i,GEN_LSD_PAD)).appendParsedKey("</>");
-
-
-
-                RecordUpdate update;
-                if (curseg.getRecordUpdate(rangekey,out update) == GetStatus.PRESENT) {
-                    if (update.type == RecordUpdateTypes.FULL) {
-
-                        SegmentReader sr = segmentReaderFromRow(rangekey,update);
-
-                        // RECURSE
-                        if (INTERNAL_segmentWalkForKey_OLD(key, sr, nextHandledGenerations, maxgen - 1, ref record) == RecordUpdateResult.FINAL) {
-                            return RecordUpdateResult.FINAL;
-                        }
-                    } else if (update.type == RecordUpdateTypes.DELETION_TOMBSTONE) {
-                        // A tombstone for a rangemap means we can skip it!
-                        // throw new Exception("TBD: implement handling for rangemap tombstones");
-                    } else {
-                        throw new Exception("Invalid rangerecord updatetype in walk: " + update.type.ToString());
-                    }
-
-                }
-            }
-
-            return RecordUpdateResult.SUCCESS;
-        }
-
-
-

     }


use standard mongo settings

use standard mongo settings

--- BitSharp.Storage.MongoDB/MongoDBStorageContext.cs
+++ BitSharp.Storage.MongoDB/MongoDBStorageContext.cs
@@ -29,7 +29,7 @@
         public MongoDBStorageContext(string baseDirectory, long cacheSizeMaxBytes)
         {
             var settings = MongoClientSettings.FromUrl(new MongoUrl("mongodb://localhost"));
-            settings.WriteConcern.W = 0;
+            //settings.WriteConcern.W = 0;
             //settings.WriteConcern.FSync = false;
             //settings.WriteConcern.Journal = false;
             this.client = new MongoClient(settings);


add newline back

add newline back

--- WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
+++ WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -178,4 +178,4 @@
 			return string.Join(' ', Mnemonics);
 		}
 	}
-}+}


Bug fixed: eメールの検証エラー時にエラーメッセージが正しく表示されない問題を解消。

--- Implem.Pleasanter/Libraries/Validators/ClientValidators.cs
+++ Implem.Pleasanter/Libraries/Validators/ClientValidators.cs
@@ -19,7 +19,7 @@
             {
                 case "required": return Displays.ValidateRequired();
                 case "date": return Displays.ValidateDate();
-                case "mail": return Displays.ValidateMail();
+                case "email": return Displays.ValidateMail();
                 case "equalTo": return Displays.ValidateEqualTo();
                 default: return string.Empty;
             }


Resolve #129 - Add convenience method for writing HTML reports to file

--- CSF.Screenplay.Reporting.Html/HtmlReportWriter.cs
+++ CSF.Screenplay.Reporting.Html/HtmlReportWriter.cs
@@ -74,5 +74,21 @@
       this.formattingService = formattingService;
       documentFactory = new ZptDocumentFactory();
     }
+
+    /// <summary>
+    /// Write the report to a file path.
+    /// </summary>
+    /// <param name="report">The report.</param>
+    /// <param name="path">Destination file path.</param>
+    /// <param name="formattingService">Object formatting service.</param>
+    public static void WriteToFile(Report report, string path, IObjectFormattingService formattingService = null)
+    {
+      using(var writer = new StreamWriter(path))
+      {
+        var reportWriter = new HtmlReportWriter(writer, formattingService);
+        reportWriter.Write(report);
+        writer.Flush();
+      }
+    }
   }
 }


Fail() - minor consistency improvements

Fail() - minor consistency improvements

--- CSharpFunctionalExtensions/Result/Methods/Fail.cs
+++ CSharpFunctionalExtensions/Result/Methods/Fail.cs
@@ -13,13 +13,13 @@
         [DebuggerStepThrough]
         public static Result<T> Fail<T>(string error)
         {
-            return new Result<T>(true, default(T), error);
+            return new Result<T>(true, default, error);
         }

         [DebuggerStepThrough]
         public static Result<T, E> Fail<T, E>(E error)
         {
-            return new Result<T, E>(true, default(T), error);
+            return new Result<T, E>(true, default, error);
         }
     }
 }


Ensures the ClientSidePagePipeBind objects always have a value for the _name member field

--- Commands/Base/PipeBinds/ClientSidePagePipeBind.cs
+++ Commands/Base/PipeBinds/ClientSidePagePipeBind.cs
@@ -17,7 +17,15 @@
         public ClientSidePagePipeBind(ClientSidePage page)
         {
             _page = page;
-            _name = page.PageTitle;
+            if (page.PageListItem != null)
+            {
+                File file = page.PageListItem.EnsureProperty(li => li.File);
+                _name = file.EnsureProperty(f => f.Name);
+            }
+            else
+            {
+                _name = page.PageTitle;
+            }
         }

         public ClientSidePagePipeBind(string name)


update code for SMAPI 3.4

update code for SMAPI 3.4

--- ContentPatcher/Framework/Patches/EditDataPatch.cs
+++ ContentPatcher/Framework/Patches/EditDataPatch.cs
@@ -30,9 +30,6 @@

         /// The records to reorder, if the target is a list asset.
         private EditDataPatchMoveRecord[] MoveRecords;
-
-        /// A list of warning messages which have been previously logged.
-        private readonly HashSet<string> LoggedWarnings = new HashSet<string>();

         /// Parse the data change fields for an <see cref="PatchType.EditData"/> patch.
         private readonly TryParseFieldsDelegate TryParseFields;
@@ -281,7 +278,7 @@

             // apply moves
             if (this.MoveRecords.Any())
-                this.LogOnce($"Can't move records for \"{this.LogName}\" > {nameof(PatchConfig.MoveEntries)}: target asset '{this.TargetAsset}' isn't an ordered list).", LogLevel.Warn);
+                this.Monitor.LogOnce($"Can't move records for \"{this.LogName}\" > {nameof(PatchConfig.MoveEntries)}: target asset '{this.TargetAsset}' isn't an ordered list).", LogLevel.Warn);
         }

         /// Apply the patch to a list asset.
@@ -331,7 +328,7 @@
                 TValue entry = GetByKey(moveRecord.ID.Value);
                 if (entry == null)
                 {
-                    this.LogOnce($"Can't move {errorLabel}: no entry with that ID exists.", LogLevel.Warn);
+                    this.Monitor.LogOnce($"Can't move {errorLabel}: no entry with that ID exists.", LogLevel.Warn);
                     continue;
                 }
                 int fromIndex = data.IndexOf(entry);
@@ -358,12 +355,12 @@
                     TValue anchorEntry = GetByKey(anchorID);
                     if (anchorEntry == null)
                     {
-                        this.LogOnce($"Can't move {errorLabel}: no entry with the relative ID exists.", LogLevel.Warn);
+                        this.Monitor.LogOnce($"Can't move {errorLabel}: no entry with the relative ID exists.", LogLevel.Warn);
                         continue;
                     }
                     if (object.ReferenceEquals(entry, anchorEntry))
                     {
-                        this.LogOnce($"Can't move {errorLabel}: can't move entry relative to itself.", LogLevel.Warn);
+                        this.Monitor.LogOnce($"Can't move {errorLabel}: can't move entry relative to itself.", LogLevel.Warn);
                         continue;
                     }

@@ -477,14 +474,5 @@
         {
             return InternalConstants.GetListAssetKey(entity);
         }
-
-        /// Log a message the first time it occurs.
-        /// <param name="message">The log message.</param>
-        /// <param name="level">The log level.</param>
-        private void LogOnce(string message, LogLevel level)
-        {
-            if (this.LoggedWarnings.Add(message))
-                this.Monitor.Log(message, level);
-        }
     }
 }


Fix for Bucket.EnumerateRange

Fix for Bucket.EnumerateRange

--- Core/Theraot/Collections/ThreadSafe/BucketCore.cs
+++ Core/Theraot/Collections/ThreadSafe/BucketCore.cs
@@ -210,24 +210,36 @@
             }
             var startSubIndex = SubIndex(indexFrom);
             var endSubIndex = SubIndex(indexTo);
+            return PrivateEnumerableRange(indexFrom, indexTo, startSubIndex, endSubIndex);
+        }
+
+        private IEnumerable<object> PrivateEnumerableRange(int indexFrom, int indexTo, int startSubIndex, int endSubIndex)
+        {
             var step = endSubIndex - startSubIndex >= 0 ? 1 : -1;
             for (var subindex = startSubIndex; subindex < endSubIndex + 1; subindex += step)
             {
-                var foundFirst = Interlocked.CompareExchange(ref _arrayFirst[subindex], null, null);
-                if (foundFirst == null)
-                {
-                    continue;
-                }
                 try
                 {
                     Interlocked.Increment(ref _arrayUse[subindex]);
+                    var foundFirst = Interlocked.CompareExchange(ref _arrayFirst[subindex], null, null);
                     if (_level == 1)
                     {
+                        if (foundFirst == null)
+                        {
+                            continue;
+                        }
                         yield return foundFirst;
                     }
                     else
                     {
-                        foreach (var item in ((BucketCore)foundFirst).EnumerateRange(indexFrom, indexTo))
+                        var core = foundFirst as BucketCore;
+                        if (core == null)
+                        {
+                            continue;
+                        }
+                        var subIndexFrom = subindex == startSubIndex ? core.SubIndex(indexFrom) : 0;
+                        var subIndexTo = subindex == endSubIndex ? core.SubIndex(indexTo) : (_level == 7 ? INT_Capacity_Final : INT_Capacity) - 1;
+                        foreach (var item in core.PrivateEnumerableRange(indexFrom, indexTo, subIndexFrom, subIndexTo))
                         {
                             yield return item;
                         }


small refactor for debugging

small refactor for debugging

--- Core/Theraot/Threading/Needles/Transact.Needle.cs
+++ Core/Theraot/Threading/Needles/Transact.Needle.cs
@@ -75,7 +75,8 @@
             bool IResource.CheckCapture()
             {
                 var transaction = Transact.CurrentTransaction;
-                return ReferenceEquals(_lockNeedle.Value, transaction);
+                var check = _lockNeedle.Value;
+                return ReferenceEquals(check, transaction);
             }

             bool IResource.CheckValue()


Fixed up unit tests

Fixed up unit tests

Former-commit-id: 434b9e7db5fd603ee66f5276302ff8628c29582f

--- CorrugatedIron.Tests/Models/RiakMapReduceTests.cs
+++ CorrugatedIron.Tests/Models/RiakMapReduceTests.cs
@@ -70,7 +70,13 @@
                              ContentType = Constants.ContentTypes.ApplicationJson
                          };
             mr.SetInputs("animals")
-                .Map(true, Constants.MapReduceLanguage.Json, "function(v) { return [v]; }");
+                .Map(new RiakMapReducePhase
+                    {
+                        Keep = true,
+                        MapReduceLanguage = Constants.MapReduceLanguage.JavaScript,
+                        MapReducePhaseType = Constants.MapReducePhaseType.Map,
+                        Source = "function(v) { return [v]; }"
+                    });

             var mrRequest = mr.ToMessage();

@@ -83,9 +89,20 @@
         {
             var mr = new RiakMapReduce();
             mr.SetInputs("animals")
-                .Map(false, Constants.MapReduceLanguage.JavaScript,
-                     "function(o) { if (o.key.indexOf('spider') != -1) return [1]; else return []; }")
-                .Reduce(true, Constants.MapReduceLanguage.JavaScript, "", "Riak.reduceSum");
+                .Map(new RiakMapReducePhase
+                    {
+                        Keep = false,
+                        MapReduceLanguage = Constants.MapReduceLanguage.JavaScript,
+                        MapReducePhaseType = Constants.MapReducePhaseType.Map,
+                        Source = "function(o) { if (o.key.indexOf('spider') != -1) return [1]; else return []; }"
+                    })
+                .Reduce(new RiakMapReducePhase
+                            {
+                                Keep = true,
+                                MapReduceLanguage = Constants.MapReduceLanguage.JavaScript,
+                                MapReducePhaseType = Constants.MapReducePhaseType.Reduce,
+                                Name = "Riak.reduceSum"
+                            });

             mr.ToMessage().Request.ShouldEqual(ComplexMrJobText.ToRiakString());
         }
@@ -96,9 +113,20 @@
             var mr = new RiakMapReduce();
             mr.SetInputs("animals")
                 .Filter(new Matches<string>("spider"))
-                .Map(false, Constants.MapReduceLanguage.JavaScript,
-                     "function(o) { return [1]; }")
-                .Reduce(true, Constants.MapReduceLanguage.JavaScript, "", "Riak.reduceSum");
+                .Map(new RiakMapReducePhase
+                    {
+                        Keep = false,
+                        MapReduceLanguage = Constants.MapReduceLanguage.JavaScript,
+                        MapReducePhaseType = Constants.MapReducePhaseType.Map,
+                        Source = "function(o) { return [1]; }"
+                    })
+                .Reduce(new RiakMapReducePhase
+                            {
+                                Keep = true,
+                                MapReduceLanguage = Constants.MapReduceLanguage.JavaScript,
+                                MapReducePhaseType = Constants.MapReducePhaseType.Reduce,
+                                Name = "Riak.reduceSum"
+                            });

             mr.ToMessage().Request.ShouldEqual(ComplexMrJobWithFilterText.ToRiakString());
         }


Fix taiko rim markers incorrectly playing as whistle samples

--- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
+++ osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
@@ -52,7 +52,12 @@
         protected override IEnumerable<HitSampleInfo> GetSamples()
         {
             // normal and claps are always handled by the drum (see DrumSampleMapping).
-            var samples = HitObject.Samples.Where(s => s.Name != HitSampleInfo.HIT_NORMAL && s.Name != HitSampleInfo.HIT_CLAP);
+            // in addition, whistles are excluded as they are an alternative rim marker.
+
+            var samples = HitObject.Samples.Where(s =>
+                s.Name != HitSampleInfo.HIT_NORMAL
+                && s.Name != HitSampleInfo.HIT_CLAP
+                && s.Name != HitSampleInfo.HIT_WHISTLE);

             if (HitObject.Type == HitType.Rim && HitObject.IsStrong)
             {


Comment typo and remove old dead code.

Comment typo and remove old dead code.

--- DaikonDotNetFrontEnd/DotNetFrontEnd/ILRewriter.cs
+++ DaikonDotNetFrontEnd/DotNetFrontEnd/ILRewriter.cs
@@ -307,7 +307,7 @@
     }

     /// <summary>
-    /// Mutuate the method body by adding the instrumentation calls
+    /// Mutuate the method body by adding the instrumentation calls.
     /// </summary>
     /// <param name="methodBody">The original methodBody</param>
     /// <returns>methodBody with instrumentation calls added</returns>
@@ -436,11 +436,6 @@
           RecordExceptionHandlerOffsets(immutableMethodBody);

       List<ITypeReference> exceptions = DetermineAndSortExceptions(operations);
-      // TODO(#9): Determine why this code was commented out
-      //if (this.printDeclarations)
-      //{
-      //    DeclareExceptions(methodBody, methodDef, exceptions);
-      //}

       // If the method is non-void, return in debug builds will contain a store before a jump to
       // the return point. Figure out what the store will be to detect these returns later.


PROJECTDIET-2 dividends look at db

PROJECTDIET-2 dividends look at db

--- DietPlanning.Web/Controllers/AccountController.cs
+++ DietPlanning.Web/Controllers/AccountController.cs
@@ -58,6 +58,7 @@
         public ActionResult Login(string returnUrl)
         {
             ViewBag.ReturnUrl = returnUrl;
+            //I really fucking love Jetbrains
             return View();
         }


Statement added to suppress compiler warning about unused variable (MonoDevelop 4.0.1); Maybe the line 36 can be removed.

--- Editor/SmartFormat/Extensions/DefaultFormatter.cs
+++ Editor/SmartFormat/Extensions/DefaultFormatter.cs
@@ -34,6 +34,7 @@

             //  We will try using IFormatProvider, IFormattable, and if all else fails, ToString.
             var formatter = formatDetails.Formatter;
+			if (formatter == null) {} // Force the compiler not to complain about unused variable
             string result = null;
             ICustomFormatter cFormatter;
             IFormattable formattable;


Fixed comparison bug introduced in changeset 75e7533043cc.

--- FormBuilder/Validation/MaxFieldLengthAttribute.cs
+++ FormBuilder/Validation/MaxFieldLengthAttribute.cs
@@ -25,7 +25,7 @@
                         return !field.IsRequired;
                     }

-                    return value.Length < Length;
+                    return value.Length <= Length;
                 }
             };
         }


Disposing fix

Disposing fix

--- Gigya.Microdot.Hosting/Service/ServiceHostBase.cs
+++ Gigya.Microdot.Hosting/Service/ServiceHostBase.cs
@@ -350,11 +350,11 @@
             if (disposed)
                 return;

+            disposed = true;
+
             SafeDispose(StopEvent);
             SafeDispose(WindowsService);
             SafeDispose(MonitoredShutdownProcess);
-
-            disposed = true;
         }


extract methods in FieldSaveHelper

extract methods in FieldSaveHelper

--- JoinRpg.Domain/CharacterFields/FieldSaveHelper.cs
+++ JoinRpg.Domain/CharacterFields/FieldSaveHelper.cs
@@ -290,6 +290,21 @@
         {
             if (newFieldValue == null) throw new ArgumentNullException(nameof(newFieldValue));

+            var strategy = CreateStrategy(currentUserId, character, claim, generator);
+
+            var fields = strategy.LoadFields();
+
+            AssignValues(newFieldValue, fields, strategy);
+
+            GenerateDefaultValues(character, fields, strategy);
+
+            strategy.Save(fields);
+            return strategy.GetUpdatedFields();
+        }
+
+        private static FieldSaveStrategyBase CreateStrategy(int currentUserId, Character character,
+            Claim claim, IFieldDefaultValueGenerator generator)
+        {
             FieldSaveStrategyBase strategy;
             if (claim == null)
             {
@@ -306,8 +321,12 @@
                     new SaveToCharacterAndClaimStrategy(claim, character, currentUserId, generator);
             }

-            var fields = strategy.LoadFields();
-
+            return strategy;
+        }
+
+        private static void AssignValues(IReadOnlyDictionary<int, string> newFieldValue, Dictionary<int, FieldWithValue> fields,
+            FieldSaveStrategyBase strategy)
+        {
             foreach (var keyValuePair in newFieldValue)
             {
                 var field = fields[keyValuePair.Key];
@@ -318,7 +337,11 @@

                 strategy.AssignFieldValue(field, normalizedValue);
             }
-
+        }
+
+        private static void GenerateDefaultValues(Character character, Dictionary<int, FieldWithValue> fields,
+            FieldSaveStrategyBase strategy)
+        {
             foreach (var field in fields.Values.Where(
                 f => !f.HasEditableValue && f.Field.CanHaveValue() &&
                      f.Field.IsAvailableForTarget(character)))
@@ -329,9 +352,6 @@

                 strategy.AssignFieldValue(field, normalizedValue);
             }
-
-            strategy.Save(fields);
-            return strategy.GetUpdatedFields();
         }

         private static string NormalizeValueBeforeAssign(FieldWithValue field, string toAssign)


Improve 2d report

Improve 2d report

--- Joinrpg/Models/Reports/Report2DResultViewModel.cs
+++ Joinrpg/Models/Reports/Report2DResultViewModel.cs
@@ -1,6 +1,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using JoinRpg.DataModel;
+using JoinRpg.Helpers;

 namespace JoinRpg.Web.Models.Reports
 {
@@ -23,11 +24,22 @@
         );
     }

+    private static IReadOnlyCollection<Character> GetFlatCharacters(CharacterGroup group)
+    {
+      var flatChilds = group.FlatTree(model => model.ChildGroups);
+
+      var flatCharacters = flatChilds.SelectMany(c => c.Characters).Distinct().ToList();
+      return flatCharacters;
+    }
+
     private static Dictionary<int, GroupChars> GenerateSet(GameReport2DTemplate template, CharacterGroup group)
     {
-      var rowsSet = group.ChildGroups.ToDictionary(
+
+      var rowsSet = group.ChildGroups
+        .Where(g => !g.IsSpecial || !g.ChildGroups.Any())
+        .ToDictionary(
         g => g.CharacterGroupId,
-        g => new GroupChars {Name = g.CharacterGroupName, Characters = g.Characters.ToList()});
+        g => new GroupChars {Name = g.CharacterGroupName, Characters =GetFlatCharacters(g)});

       rowsSet.Add(-1,
         new GroupChars
@@ -42,7 +54,7 @@
     private class GroupChars
     {
       public string Name { get; set; }
-      public List<Character> Characters { get; set; }
+      public IReadOnlyCollection<Character> Characters { get; set; }
     }

     private static Dictionary<int, string> GetChildGroups(Dictionary<int, GroupChars> gr)


Resolved #3911: Add IIocManager to AbpIntegratedTestBase constructor

--- src/Abp.TestBase/TestBase/AbpIntegratedTestBase.cs
+++ src/Abp.TestBase/TestBase/AbpIntegratedTestBase.cs
@@ -27,9 +27,9 @@
         /// </summary>
         protected TestAbpSession AbpSession { get; private set; }

-        protected AbpIntegratedTestBase(bool initializeAbp = true)
+        protected AbpIntegratedTestBase(bool initializeAbp = true, IIocManager localIocManager = null)
         {
-            LocalIocManager = new IocManager();
+            LocalIocManager = localIocManager ?? new IocManager();

             AbpBootstrapper = AbpBootstrapper.Create<TStartupModule>(options =>
             {


Change if to switch expression

Change if to switch expression

--- src/AsmResolver.PE/Debug/DefaultDebugDataReader.cs
+++ src/AsmResolver.PE/Debug/DefaultDebugDataReader.cs
@@ -11,10 +11,11 @@
         public IDebugDataSegment ReadDebugData(PEReaderContext context, DebugDataType type,
             IBinaryStreamReader reader)
         {
-            if (type == DebugDataType.CodeView)
-                return CodeViewDataSegment.FromReader(reader);
-
-            return new CustomDebugDataSegment(type, DataSegment.FromReader(reader));
+            return type switch
+            {
+                DebugDataType.CodeView => CodeViewDataSegment.FromReader(reader, context),
+                _ => new CustomDebugDataSegment(type, DataSegment.FromReader(reader))
+            };
         }
     }
 }


Snap dirty rects in DeferredRenderer to device pixels.

Fixes #2015.

--- src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
+++ src/Avalonia.Visuals/Rendering/DeferredRenderer.cs
@@ -393,24 +393,36 @@
                         }
                         else
                         {
+                            var scale = scene.Scaling;
+
                             foreach (var rect in layer.Dirty)
                             {
+                                var snappedRect = SnapToDevicePixels(rect, scale);
                                 context.Transform = Matrix.Identity;
-                                context.PushClip(rect);
+                                context.PushClip(snappedRect);
                                 context.Clear(Colors.Transparent);
-                                Render(context, node, layer.LayerRoot, rect);
+                                Render(context, node, layer.LayerRoot, snappedRect);
                                 context.PopClip();

                                 if (DrawDirtyRects)
                                 {
-                                    _dirtyRectsDisplay.Add(rect);
+                                    _dirtyRectsDisplay.Add(snappedRect);
                                 }
                             }
                         }
                     }
                 }
             }
-
+        }
+
+        private static Rect SnapToDevicePixels(Rect rect, double scale)
+        {
+            return new Rect(
+                Math.Floor(rect.X * scale) / scale,
+                Math.Floor(rect.Y * scale) / scale,
+                Math.Ceiling(rect.Width * scale) / scale,
+                Math.Ceiling(rect.Height * scale) / scale);
+
         }

         private void RenderOverlay(Scene scene, IDrawingContextImpl parentContent)


BL-5470 Make more room for button

BL-5470 Make more room for button

* Some "Make a BloomPack" localizations needed
   more room (e.g. Spanish)

--- src/BloomExe/CollectionTab/LibraryView.Designer.cs
+++ src/BloomExe/CollectionTab/LibraryView.Designer.cs
@@ -31,10 +31,10 @@
 			this.components = new System.ComponentModel.Container();
 			this._topBarControl = new System.Windows.Forms.Panel();
 			this._toolStrip = new System.Windows.Forms.ToolStrip();
+			this._sendReceiveButton = new System.Windows.Forms.ToolStripButton();
 			this._makeBloomPackButton = new System.Windows.Forms.ToolStripButton();
 			this._settingsButton = new System.Windows.Forms.ToolStripButton();
 			this._openCreateCollectionButton = new System.Windows.Forms.ToolStripButton();
-			this._sendReceiveButton = new System.Windows.Forms.ToolStripButton();
 			this._L10NSharpExtender = new L10NSharp.UI.L10NSharpExtender(this.components);
 			this.splitContainer1 = new Bloom.ToPalaso.BetterSplitContainer(this.components);
 			this._topBarControl.SuspendLayout();
@@ -47,11 +47,12 @@
 			// _topBarControl
 			//
 			this._topBarControl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+			this._topBarControl.AutoSize = true;
 			this._topBarControl.BackColor = System.Drawing.Color.Cyan;
 			this._topBarControl.Controls.Add(this._toolStrip);
-			this._topBarControl.Location = new System.Drawing.Point(223, 224);
+			this._topBarControl.Location = new System.Drawing.Point(187, 224);
 			this._topBarControl.Name = "_topBarControl";
-			this._topBarControl.Size = new System.Drawing.Size(327, 70);
+			this._topBarControl.Size = new System.Drawing.Size(373, 70);
 			this._topBarControl.TabIndex = 15;
 			//
 			// _toolStrip
@@ -69,12 +70,26 @@
 			this._L10NSharpExtender.SetLocalizationComment(this._toolStrip, null);
 			this._L10NSharpExtender.SetLocalizationPriority(this._toolStrip, L10NSharp.LocalizationPriority.NotLocalizable);
 			this._L10NSharpExtender.SetLocalizingId(this._toolStrip, "WorkspaceView._toolStrip");
-			this._toolStrip.Location = new System.Drawing.Point(-13, 0);
+			this._toolStrip.Location = new System.Drawing.Point(0, 0);
 			this._toolStrip.Name = "_toolStrip";
 			this._toolStrip.RightToLeft = System.Windows.Forms.RightToLeft.No;
-			this._toolStrip.Size = new System.Drawing.Size(340, 70);
+			this._toolStrip.Size = new System.Drawing.Size(373, 70);
 			this._toolStrip.TabIndex = 31;
 			this._toolStrip.Text = "_toolStrip";
+			//
+			// _sendReceiveButton
+			//
+			this._sendReceiveButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+			this._sendReceiveButton.Image = global::Bloom.Properties.Resources.sendreceiveToolbarButton;
+			this._sendReceiveButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+			this._sendReceiveButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+			this._L10NSharpExtender.SetLocalizableToolTip(this._sendReceiveButton, null);
+			this._L10NSharpExtender.SetLocalizationComment(this._sendReceiveButton, null);
+			this._L10NSharpExtender.SetLocalizingId(this._sendReceiveButton, "CollectionTab.SendReceive");
+			this._sendReceiveButton.Name = "_sendReceiveButton";
+			this._sendReceiveButton.Size = new System.Drawing.Size(82, 67);
+			this._sendReceiveButton.Text = "Send/Receive";
+			this._sendReceiveButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
 			//
 			// _makeBloomPackButton
 			//
@@ -86,7 +101,7 @@
 			this._L10NSharpExtender.SetLocalizationComment(this._makeBloomPackButton, null);
 			this._L10NSharpExtender.SetLocalizingId(this._makeBloomPackButton, "CollectionTab.MakeBloomPackButton");
 			this._makeBloomPackButton.Name = "_makeBloomPackButton";
-			this._makeBloomPackButton.Size = new System.Drawing.Size(106, 43);
+			this._makeBloomPackButton.Size = new System.Drawing.Size(106, 67);
 			this._makeBloomPackButton.Text = "Make Bloom Pack";
 			this._makeBloomPackButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
 			this._makeBloomPackButton.Click += new System.EventHandler(this.OnMakeBloomPackButton_Click);
@@ -101,7 +116,7 @@
 			this._L10NSharpExtender.SetLocalizationComment(this._settingsButton, null);
 			this._L10NSharpExtender.SetLocalizingId(this._settingsButton, "CollectionTab.SettingsButton");
 			this._settingsButton.Name = "_settingsButton";
-			this._settingsButton.Size = new System.Drawing.Size(53, 43);
+			this._settingsButton.Size = new System.Drawing.Size(53, 67);
 			this._settingsButton.Text = "Settings";
 			this._settingsButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
 			this._settingsButton.Click += new System.EventHandler(this._settingsButton_Click);
@@ -117,24 +132,10 @@
         " from a repository somewhere.");
 			this._L10NSharpExtender.SetLocalizingId(this._openCreateCollectionButton, "CollectionTab.Open/CreateCollectionButton");
 			this._openCreateCollectionButton.Name = "_openCreateCollectionButton";
-			this._openCreateCollectionButton.Size = new System.Drawing.Size(98, 43);
+			this._openCreateCollectionButton.Size = new System.Drawing.Size(98, 67);
 			this._openCreateCollectionButton.Text = "Other Collection";
 			this._openCreateCollectionButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
 			this._openCreateCollectionButton.Click += new System.EventHandler(this._openCreateCollectionButton_Click);
-			//
-			// _sendReceiveButton
-			//
-			this._sendReceiveButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
-			this._sendReceiveButton.Image = global::Bloom.Properties.Resources.sendreceiveToolbarButton;
-			this._sendReceiveButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
-			this._sendReceiveButton.ImageTransparentColor = System.Drawing.Color.Magenta;
-			this._L10NSharpExtender.SetLocalizableToolTip(this._sendReceiveButton, null);
-			this._L10NSharpExtender.SetLocalizationComment(this._sendReceiveButton, null);
-			this._L10NSharpExtender.SetLocalizingId(this._sendReceiveButton, "CollectionTab.SendReceive");
-			this._sendReceiveButton.Name = "_sendReceiveButton";
-			this._sendReceiveButton.Size = new System.Drawing.Size(82, 43);
-			this._sendReceiveButton.Text = "Send/Receive";
-			this._sendReceiveButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
 			//
 			// _L10NSharpExtender
 			//
@@ -175,6 +176,7 @@
 			((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
 			this.splitContainer1.ResumeLayout(false);
 			this.ResumeLayout(false);
+			this.PerformLayout();

         }


Better command name.

Better command name.

--- src/Cedar.HttpCommandHandling.Example/01_Simple.cs
+++ src/Cedar.HttpCommandHandling.Example/01_Simple.cs
@@ -12,10 +12,10 @@
     using Microsoft.Owin.Hosting;

     // 1. Simple commands.
-    public class CommandSyncHandler
+    public class CommandWithSyncHandler
     {}

-    public class CommandAsyncHandler
+    public class CommandWithAsyncHandler
     {}

@@ -34,10 +34,10 @@
         // should be injected as factory methods / funcs.
         public CommandModule(Func<IFoo> getFoo)
         {
-            For<CommandSyncHandler>()
+            For<CommandWithSyncHandler>()
                 .Handle(commandMessage => getFoo().Bar());

-            For<CommandAsyncHandler>()
+            For<CommandWithAsyncHandler>()
                 .Handle(async (commandMessage, ct) =>
                 {
                     var foo = getFoo();


Respond to PR feedback

Respond to PR feedback

--- src/Common/src/System/Net/HttpStatusDescription.cs
+++ src/Common/src/System/Net/HttpStatusDescription.cs
@@ -20,6 +20,7 @@
                 case 100: return "Continue";
                 case 101: return "Switching Protocols";
                 case 102: return "Processing";
+
                 case 200: return "OK";
                 case 201: return "Created";
                 case 202: return "Accepted";
@@ -28,6 +29,7 @@
                 case 205: return "Reset Content";
                 case 206: return "Partial Content";
                 case 207: return "Multi-Status";
+
                 case 300: return "Multiple Choices";
                 case 301: return "Moved Permanently";
                 case 302: return "Found";
@@ -35,6 +37,7 @@
                 case 304: return "Not Modified";
                 case 305: return "Use Proxy";
                 case 307: return "Temporary Redirect";
+
                 case 400: return "Bad Request";
                 case 401: return "Unauthorized";
                 case 402: return "Payment Required";
@@ -57,6 +60,7 @@
                 case 423: return "Locked";
                 case 424: return "Failed Dependency";
                 case 426: return "Upgrade Required"; // RFC 2817
+
                 case 500: return "Internal Server Error";
                 case 501: return "Not Implemented";
                 case 502: return "Bad Gateway";


Rebase with master

Rebase with master

--- src/Couchbase.Lite.Shared/Util/ExtensionMethods.cs
+++ src/Couchbase.Lite.Shared/Util/ExtensionMethods.cs
@@ -108,7 +108,7 @@
             var unescapedUserInfo = uri.UserEscaped
                 ? Uri.UnescapeDataString(uri.UserInfo)
                 : uri.UserInfo;
-
+
             var param = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(unescapedUserInfo));

             return new AuthenticationHeaderValue(scheme, param);


Add shard validation during READY event

Add shard validation during READY event

Closes #61

--- src/Discore/WebSocket/Internal/Gateway.Dispatch.cs
+++ src/Discore/WebSocket/Internal/Gateway.Dispatch.cs
@@ -87,6 +87,19 @@
             int protocolVersion = data.GetInteger("v").Value;
             if (protocolVersion != GATEWAY_VERSION)
                 log.LogError($"[Ready] Gateway protocol mismatch! Expected v{GATEWAY_VERSION}, got {protocolVersion}.");
+
+            // Check shard
+            if (shard.Id != 0 || totalShards > 1)
+            {
+                IList<DiscordApiData> shardData = data.GetArray("shard");
+                if (shardData != null)
+                {
+                    if (shardData.Count > 0 && shardData[0].ToInteger() != shard.Id)
+                        log.LogError($"[Ready] Shard ID mismatch! Expected {shard.Id}, got {shardData[0].ToInteger()}");
+                    if (shardData.Count > 1 && shardData[1].ToInteger() != totalShards)
+                        log.LogError($"[Ready] Total shards mismatch! Expected {totalShards}, got {shardData[1].ToInteger()}");
+                }
+            }

             // Clear the cache
             cache.Clear();


CommandFactory tests

CommandFactory tests

--- src/Hangman.Tests/Factories/CommandFactoryTests.cs
+++ src/Hangman.Tests/Factories/CommandFactoryTests.cs
@@ -6,6 +6,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using Hangman.Logic.Contracts;
+using Hangman.Logic.Commands;

 namespace Hangman.Logic.Factories.Tests
 {
@@ -22,5 +23,55 @@
             var factory = new CommandFactory();
             ICommand command=factory.CreateCommand(commandString);
         }
+
+        [TestCase("exit")]
+        [TestCase("Exit")]
+        [TestCase("EXIT")]
+        public void CreateCommandExitSteingShouldCreateExitCommandTest(string input)
+        {
+            var factory = new CommandFactory();
+            ICommand command=factory.CreateCommand(input);
+            Assert.AreNotSame(command, new Exit());
+        }
+
+        [TestCase("help")]
+        [TestCase("Help")]
+        [TestCase("HELP")]
+        public void CreateCommandHelpInputShouldCreateHelpCommandTest(string input)
+        {
+            var factory = new CommandFactory();
+            ICommand command=factory.CreateCommand(input);
+            Assert.AreNotSame(command, new Help());
+        }
+
+        [TestCase("a")]
+        [TestCase("A")]
+        [TestCase("h")]
+        public void CreateCommandCharInputShouldCreateGuessCommandTest(string input)
+        {
+            var factory = new CommandFactory();
+            ICommand command=factory.CreateCommand(input);
+            Assert.AreNotSame(command, new LetterGuess(input));
+        }
+
+        [TestCase("restart")]
+        [TestCase("Restart")]
+        [TestCase("RESTART")]
+        public void CreateCommandRestartInputShouldCreateRestartCommandTest(string input)
+        {
+            var factory = new CommandFactory();
+            ICommand command=factory.CreateCommand(input);
+            Assert.AreNotSame(command, new Restart());
+        }
+
+        [TestCase("top")]
+        [TestCase("Top")]
+        [TestCase("TOP")]
+        public void CreateCommandTopInputShouldCreateTopCommandTest(string input)
+        {
+            var factory = new CommandFactory();
+            ICommand command=factory.CreateCommand(input);
+            Assert.AreNotSame(command, new Top());
+        }
     }
 }


Fix area selector not appearing after first screenshot

--- src/HolzShots.Core/Input/Selection/AreaSelector.cs
+++ src/HolzShots.Core/Input/Selection/AreaSelector.cs
@@ -290,6 +290,9 @@
             }

             Debug.Assert(_tcs != null);
+            Debug.Assert(SelectionSemaphore.IsInAreaSelection);
+            SelectionSemaphore.IsInAreaSelection = false;
+
             _tcs.SetResult(state.Result);
             CloseInternal();
         }


Simplify resolve path check

Simplify resolve path check

--- src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs
+++ src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs
@@ -225,7 +225,7 @@
         {
             public WrappedApplicationEnvironment(string applicationBasePath, IApplicationEnvironment env)
             {
-                ApplicationBasePath = ResolvePath(applicationBasePath);
+                ApplicationBasePath = ResolvePath(applicationBasePath, env.ApplicationBasePath);
                 ApplicationName = env.ApplicationName;
                 ApplicationVersion = env.ApplicationVersion;
                 RuntimeFramework = env.RuntimeFramework;
@@ -240,20 +240,13 @@
             public FrameworkName RuntimeFramework { get; }
         }

-        private static string ResolvePath(string applicationBasePath)
+        private static string ResolvePath(string applicationBasePath, string basePath)
         {
             if (Path.IsPathRooted(applicationBasePath))
             {
                 return applicationBasePath;
             }

-            var basePath =
-#if NET451
-                (string)AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY") ??
-                AppDomain.CurrentDomain.BaseDirectory;
-#else
-                AppContext.BaseDirectory;
-#endif
             return Path.Combine(Path.GetFullPath(basePath), applicationBasePath);
         }
     }


Return sensor value as JSON

Return sensor value as JSON

--- src/MindstormR.Server.Nancy/Modules/RobotModule.cs
+++ src/MindstormR.Server.Nancy/Modules/RobotModule.cs
@@ -96,7 +96,7 @@
             object value;
             if (data.TryGetValue(parameters.sensor, out value))
             {
-                return value;
+                return Response.AsJson(new { value = value });
             }

             return null;


remove NamedConstantExtensions.ToNonNull()

--- src/MvbaCore/Extensions/NamedConstantExtensions.cs
+++ src/MvbaCore/Extensions/NamedConstantExtensions.cs
@@ -30,15 +30,5 @@
 			}
 			return DefaultValue<T>();
 		}
-
-		[NotNull, Obsolete("use .OrDefault()")]
-		public static T ToNonNull<T>([CanBeNull] this T value) where T : NamedConstant<T>
-		{
-			if (value != null)
-			{
-				return value;
-			}
-			return DefaultValue<T>();
-		}
 	}
 }


Saving updated data migrations document

Saving updated data migrations document

--- src/Orchard.Data/Migration/DataMigrationManager.cs
+++ src/Orchard.Data/Migration/DataMigrationManager.cs
@@ -242,6 +242,11 @@
                         _session.Cancel();
                         throw new OrchardException(T("Error while running migration version {0} for {1}.", current, feature), ex);
                     }
+                    finally
+                    {
+                        // Persist data migrations
+                        _session.Save(_dataMigrationRecord);
+                    }
                 });
             }
         }


Add before and after delete hooks for extension

--- src/Rainbow/Storage/SerializationFileSystemTree.cs
+++ src/Rainbow/Storage/SerializationFileSystemTree.cs
@@ -194,14 +194,26 @@
 			{
 				lock (FileUtil.GetFileLock(descendant.SerializedItemId))
 				{
+					BeforeFilesystemDelete(descendant.SerializedItemId);
 					File.Delete(descendant.SerializedItemId);
+					AfterFilesystemDelete(descendant.SerializedItemId);

 					var childrenDirectory = Path.ChangeExtension(descendant.SerializedItemId, null);

-					if (Directory.Exists(childrenDirectory)) Directory.Delete(childrenDirectory, true);
+					if (Directory.Exists(childrenDirectory))
+					{
+						BeforeFilesystemDelete(childrenDirectory);
+						Directory.Delete(childrenDirectory, true);
+						AfterFilesystemDelete(childrenDirectory);
+					}

 					var shortChildrenDirectory = Path.Combine(PhysicalRootPath, descendant.Id.ToString());
-					if (Directory.Exists(shortChildrenDirectory)) Directory.Delete(shortChildrenDirectory);
+					if (Directory.Exists(shortChildrenDirectory))
+					{
+						BeforeFilesystemDelete(shortChildrenDirectory);
+						Directory.Delete(shortChildrenDirectory);
+						AfterFilesystemDelete(shortChildrenDirectory);
+					}
 				}
 			}

@@ -767,6 +779,22 @@
 			}
 		}

+		/// <summary>
+		/// Fired before SFS deletes a file or directory
+		/// </summary>
+		protected virtual void BeforeFilesystemDelete(string path)
+		{
+
+		}
+
+		/// <summary>
+		/// Fired after SFS deletes a file or directory
+		/// </summary>
+		protected virtual void AfterFilesystemDelete(string path)
+		{
+
+		}
+
 		protected class WrittenItemMetadata : IItemMetadata
 		{
 			public WrittenItemMetadata(Guid id, Guid parentId, Guid templateId, string path, string serializedItemId)


considering array instead of single instance to indicate `InvalidOperationException` of `Single()`, `First()`, and `Last()` operations

--- src/Remote.Linq/DynamicQuery/ObjectResultCaster.cs
+++ src/Remote.Linq/DynamicQuery/ObjectResultCaster.cs
@@ -2,11 +2,44 @@

 namespace Remote.Linq.DynamicQuery
 {
+    using Aqua.TypeSystem;
+    using System;
     using System.Linq.Expressions;
+    using System.Reflection;

     internal sealed class ObjectResultCaster : IQueryResultMapper<object>
     {
         public TResult MapResult<TResult>(object source, Expression expression)
-            => (TResult)source;
+        {
+            var sourceType = source?.GetType();
+            if (sourceType?.IsArray ?? false)
+            {
+                var elementType = TypeHelper.GetElementType(sourceType);
+                if (typeof(TResult).IsAssignableFrom(elementType))
+                {
+                    try
+                    {
+                        if ((expression as MethodCallExpression)?.Arguments.Count == 2)
+                        {
+                            var predicate = GetTruePredicate(elementType);
+                            source = MethodInfos.Enumerable.SingleWithFilter.MakeGenericMethod(elementType).Invoke(null, new object[] { source, predicate });
+                        }
+                        else
+                        {
+                            source = MethodInfos.Enumerable.Single.MakeGenericMethod(elementType).Invoke(null, new object[] { source });
+                        }
+                    }
+                    catch (TargetInvocationException ex)
+                    {
+                        throw ex.InnerException;
+                    }
+                }
+            }
+
+            return (TResult)source;
+        }
+
+        private static object GetTruePredicate(Type t)
+            => Expression.Lambda(Expression.Constant(true), Expression.Parameter(t)).Compile();
     }
 }


Removed redundant controllerconstant values in legacy site

--- src/SFA.DAS.EAS.Web/Helpers/ControllerConstants.cs
+++ src/SFA.DAS.EAS.Web/Helpers/ControllerConstants.cs
@@ -2,81 +2,48 @@
 {
     public static class ControllerConstants
     {
-        public const string AboutYourAgreement = "AboutYourAgreement";
         public const string AccessDeniedViewName = "AccessDenied";
-        public const string AccessDeniedControllerName = "AccessDenied";
         public const string AccountHashedIdRouteKeyName = "HashedAccountId";
         public const string ActionKeyName = "Action";
         public const string ActivitiesUnavailableMessage = "Activities are currently unavailable.";
         public const string AddOrganisationAddressViewName = "../OrganisationShared/AddOrganisationAddress";
         public const string AddOrganisationAddressActionName = "AddOrganisationAddress";
-        public const string AddOrganisationViewName = "AddOrganisation";
         public const string AddOtherOrganisationDetailsViewName = "AddOtherOrganisationDetails";
         public const string CodeKeyName = "code";
         public const string ControllerKeyName = "Controller";
         public const string ConfirmOrganisationDetailsViewName = "../OrganisationShared/ConfirmOrganisationDetails";
         public const string ConfirmPayeSchemeActionName = "ConfirmPayeScheme";
         public const string ConfirmRemoveOrganisationActionName = "ConfirmRemoveOrganisation";
-        public const string CoursePaymentSummaryViewName = "CoursePaymentSummary";
         public const string EmailClaimKeyName = "email";
-        public const string EmployerAccountsBaseUrlKeyName = "EmployerAccountsBaseUrl";
-        public const string EmployerAccountOrganisationControllerName = "EmployerAccountOrganisation";
-        public const string EmployerAccountViewName = "EmployerAccount";
         public const string EmployerAccountControllerName = "EmployerAccount";
         public const string EmployerAccountTransactionsControllerName = "EmployerAccountTransactions";
         public const string EmployerAccountPayeControllerName = "EmployerAccountPaye";
         public const string EmployerAgreementControllerName = "EmployerAgreement";
         public const string EmployerCommitmentsBaseUrlKeyName = "EmployerCommitmentsBaseUrl";
-        public const string EmployerCommitmentsControllerName = "EmployerCommitments";
-        public const string EmployerFinanceBaseUrlKeyName = "EmployerFinanceBaseUrl";
-        public const string EmployerProjectionsBaseUrlKeyName = "EmployerProjectionsBaseUrl";
-        public const string EmployerRecruitBaseUrlKeyName = "EmployerRecruitBaseUrl";
         public const string EmployerTeamActionName = "EmployerTeam";
         public const string EmployerTeamControllerName = "EmployerTeam";
-        public const string ErrorControllerName = "Error";
-        public const string FeatureNotEnabledViewName = "FeatureNotEnabled";
         public const string FindAddressViewName = "../OrganisationShared/FindAddress";
         public const string GatewayInformActionName = "GatewayInform";
         public const string GatewayInformViewName = "GatewayInform";
-        public const string GatewayViewName = "Gateway";
-        public const string GateWayResponseActionName = "GateWayResponse";
         public const string GetGatewayActionName = "GetGateway";
         public const string HomeControllerName = "Home";
         public const string IndexActionName = "Index";
-        public const string InformActionName = "Inform";
-        public const string InviteActionName = "Invite";
         public const string InvitationControllerName = "Invitation";
         public const string InvitationIndexName = "All";
         public const string LegalAgreementViewName = "LegalAgreement";
-        public const string ModelStateTempDataKey = "ModelState";
         public const string NextStepsActionName = "NextSteps";
         public const string NotFoundViewName = "NotFound";
         public const string NotificationSettingsActionName = "NotificationSettings";
-        public const string OrganisationAddedNextStepsActionName = "OrganisationAddedNextSteps";
-        public const string OrganisationAddedNextStepsViewName = "OrganisationAddedNextSteps";
-        public const string OrganisationAddedNextStepsSearchActionName = "OrganisationAddedNextStepsSearch";
-        public const string OrganisationUpdatedNextStepsActionName = "OrganisationUpdatedNextSteps";
-        public const string OrganisationControllerName = "Organisation";
         public const string OrganisationSharedControllerName = "OrganisationShared";
-        public const string ProviderPaymentSummaryViewName = "ProviderPaymentSummary";
         public const string PdfContentTypeName = "application/pdf";
         public const string RegisterUserActionName = "RegisterUser";
         public const string RemoveViewName = "Remove";
-        public const string SearchOrganisationControllerName = "SearchOrganisation";
-        public const string SearchForOrganisationActionName = "SearchForOrganisation";
-        public const string SearchForOrganisationViewName = "SearchForOrganisation";
-        public const string SearchForOrganisationResultsActionName = "SearchForOrganisationResults";
-        public const string SearchForOrganisationResultsViewName = "SearchForOrganisationResults";
         public const string ServiceStartPageViewName = "ServiceStartPage";
         public const string SetupAccountViewName = "SetupAccount";
         public const string SignAgreementViewName = "SignAgreement";
         public const string SignInActionName = "SignIn";
-        public const string SummaryActionName = "Summary";
-        public const string ViewTeamActionName = "ViewTeam";
-        public const string ViewTeamViewName = "ViewTeam";
         public const string WhatYoullNeedActionName = "WhatYoullNeed";
         public const string TransfersControllerName = "Transfers";
-        public const string TransferDetailsViewName = "TransferDetails";
         public const string UserRefClaimKeyName = "sub";
     }
 }


311: fix date error

311: fix date error

--- src/SharpConnect.MySql/0_Public/MySqlDataReader.cs
+++ src/SharpConnect.MySql/0_Public/MySqlDataReader.cs
@@ -356,7 +356,7 @@

                         //handle datetime
                         //TODO: review other invalid datetime eg 0000-00-00 00:00, 0000-00-00 00:00:00
-                        if (data.myString == "0000-00-00")
+                        if (data.myString.StartsWith("0000-00-00"))
                         {
                             data.myDateTime = DateTime.MinValue;//?
                             data.type = type;
@@ -382,14 +382,18 @@
                         {
                             tmpStringBuilder.Append(' ' + qparsingConfig.TimeZone);
                         }
-                        //var dt;
-                        //    dt = new Date(dateString);
-                        //    if (isNaN(dt.getTime())) {
-                        //      return originalString;
-                        //    }
-
-                        data.myDateTime = DateTime.Parse(tmpStringBuilder.ToString(),
-                            System.Globalization.CultureInfo.InvariantCulture);
+
+                        if (!DateTime.TryParse(tmpStringBuilder.ToString(),
+                            System.Globalization.CultureInfo.InvariantCulture,
+                            System.Globalization.DateTimeStyles.None,
+                            out data.myDateTime))
+                        {
+                            //warning....
+                            data.myDateTime = DateTime.MinValue;
+                        }
+
+                        //data.myDateTime = DateTime.Parse(tmpStringBuilder.ToString(),
+                        //    System.Globalization.CultureInfo.InvariantCulture);
                         data.type = type;
                         tmpStringBuilder.Length = 0;//clear
                     }


Minor change

Minor change

Added tab to event snippets so that cycling into the event declaration
is indented properly.

--- Program/SublimePapyrus.cs
+++ Program/SublimePapyrus.cs
@@ -340,7 +340,7 @@
                                                 j++;
                                             }
                                         }
-                                        sw.Write(")\n${0}\nEndEvent]]></content>\n");
+                                        sw.Write(")\n\t${0}\nEndEvent]]></content>\n");
                                         CountEvent++;
                                     }
                                     else if (FunctionPattern.IsMatch(line))


Improve consistency of NotifyCollectionChangedEx/Extensions Remove ApplyNotifyCollectionChangedEventArgsToObservableCollection catching code

--- LightWands.cs
+++ LightWands.cs
@@ -1382,6 +1382,56 @@
     #endregion

+    #region NotifyCollectionChangedEx
+#if USE_INTERNAL
+    internal
+#else
+    public
+#endif
+    static class NotifyCollectionChangedEx
+    {
+        /// <summary>
+        /// NotifyCollectionChangedEventArgs の内容を ObservableCollection に反映します。
+        /// </summary>
+        /// <param name="changeCollection">このコレクションの要素が変更されます。</param>
+        public static void ApplyNotifyCollectionChangedEventArgsToObservableCollection<Tsource, TcollectionChanged>(ObservableCollection<Tsource> changeCollection, NotifyCollectionChangedEventArgs e, Func<TcollectionChanged, Tsource> converter)
+        {
+            Contract.Requires<ArgumentNullException>(changeCollection != null);
+            Contract.Requires<ArgumentNullException>(e != null);
+
+            switch (e.Action)
+            {
+                case NotifyCollectionChangedAction.Add:
+                    foreach (var i in e.NewItems.Cast<TcollectionChanged>())
+                    {
+                        changeCollection.Add(converter(i));
+                    }
+                    return;
+                case NotifyCollectionChangedAction.Move:
+                    changeCollection.Move(e.OldStartingIndex, e.NewStartingIndex);
+                    return;
+                case NotifyCollectionChangedAction.Remove:
+                    changeCollection.RemoveAt(e.OldStartingIndex);
+                    return;
+                case NotifyCollectionChangedAction.Replace:
+                    changeCollection[e.NewStartingIndex] = converter((TcollectionChanged)e.NewItems[0]);
+                    return;
+                case NotifyCollectionChangedAction.Reset:
+                    changeCollection.Clear();
+                    if (e.NewItems != null)
+                    {
+                        foreach (var i in e.NewItems.Cast<TcollectionChanged>())
+                        {
+                            changeCollection.Add(converter(i));
+                        }
+                    }
+                    return;
+            }
+        }
+    }
+    #endregion
+
+
     #region NotifyCollectionChangedExtensions
 #if USE_INTERNAL
     internal
@@ -1416,54 +1466,8 @@
                     newOc = new ObservableCollection<TResult>();
                 }
             }
-            newOc.CollectionChanged += (_, e) => ApplyNotifyCollectionChangedEventArgsToObservableCollection(newOc, e, selector);
+            newOc.CollectionChanged += (_, e) => NotifyCollectionChangedEx.ApplyNotifyCollectionChangedEventArgsToObservableCollection(newOc, e, selector);
             return newOc;
-        }
-
-        /// <summary>
-        /// NotifyCollectionChangedEventArgs の内容を ObservableCollection に反映します。
-        /// </summary>
-        /// <param name="changeCollection">このコレクションの要素が変更されます。</param>
-        public static void ApplyNotifyCollectionChangedEventArgsToObservableCollection<Tsource, TcollectionChanged>(ObservableCollection<Tsource> changeCollection, NotifyCollectionChangedEventArgs e, Func<TcollectionChanged, Tsource> converter)
-        {
-            Contract.Requires<ArgumentNullException>(changeCollection != null);
-            Contract.Requires<ArgumentNullException>(e != null);
-
-            try
-            {
-                switch (e.Action)
-                {
-                    case NotifyCollectionChangedAction.Add:
-                        foreach (var i in e.NewItems.Cast<TcollectionChanged>())
-                        {
-                            changeCollection.Add(converter(i));
-                        }
-                        return;
-                    case NotifyCollectionChangedAction.Move:
-                        changeCollection.Move(e.OldStartingIndex, e.NewStartingIndex);
-                        return;
-                    case NotifyCollectionChangedAction.Remove:
-                        changeCollection.RemoveAt(e.OldStartingIndex);
-                        return;
-                    case NotifyCollectionChangedAction.Replace:
-                        changeCollection[e.NewStartingIndex] = converter((TcollectionChanged)e.NewItems[0]);
-                        return;
-                    case NotifyCollectionChangedAction.Reset:
-                        changeCollection.Clear();
-                        if (e.NewItems != null)
-                        {
-                            foreach (var i in e.NewItems.Cast<TcollectionChanged>())
-                            {
-                                changeCollection.Add(converter(i));
-                            }
-                        }
-                        return;
-                }
-            }
-            catch (NullReferenceException)
-            {
-                // 原因不明の例外
-            }
         }
     }
     #endregion


Add EnumerableEx.DoWhenDebug

Add EnumerableEx.DoWhenDebug

--- LightWands.cs
+++ LightWands.cs
@@ -210,6 +210,18 @@
                 index++;
                 yield return item;
             }
+        }
+
+        public static IEnumerable<T> DoWhenDebug<T>(this IEnumerable<T> source, Action<T> action)
+        {
+            Contract.Requires<ArgumentNullException>(source != null);
+            Contract.Requires<ArgumentNullException>(action != null);
+
+#if DEBUG
+            return source.Do(action);
+#else
+            return source;
+#endif
         }

         public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)


quick fix (#1522)

quick fix (#1522)

--- src/Stratis.Bitcoin/Consensus/ChainedHeaderTree.cs
+++ src/Stratis.Bitcoin/Consensus/ChainedHeaderTree.cs
@@ -702,6 +702,9 @@
                 connectNewHeadersResult = this.MarkBetterChainAsRequired(latestNewHeader);
             }

+            if (connectNewHeadersResult == null)
+                connectNewHeadersResult = new ConnectNewHeadersResult() { Consumed = latestNewHeader };
+
             this.logger.LogTrace("(-):{0}", connectNewHeadersResult);
             return connectNewHeadersResult;
         }


Fixes attempted commits with no changes (#43)

* Fixes attempted commits with no changes

* Spaces

--- TGServerService/Repository.cs
+++ TGServerService/Repository.cs
@@ -18,8 +18,8 @@
 		const string RepoData = RepoPath + "/data";
 		const string RepoErrorUpToDate = "Already up to date!";
 		const string SSHPushRemote = "ssh_push_target";
-        const string PrivateKeyPath = "RepoKey/private_key.txt";
-        const string PublicKeyPath = "RepoKey/public_key.txt";
+		const string PrivateKeyPath = "RepoKey/private_key.txt";
+		const string PublicKeyPath = "RepoKey/public_key.txt";
 		const string PRJobFile = "prtestjob.json";
 		const string CommitMessage = "Automatic changelog compile, [ci skip]";

@@ -656,6 +656,9 @@
 					Commands.Stage(Repo, "html/changelog.html");
 					Commands.Stage(Repo, "html/changelogs");

+					if (Repo.RetrieveStatus().Added.Count() == 0)   //nothing to commit
+						return null;
+
 					// Create the committer's signature and commit
 					var authorandcommitter = MakeSig();

@@ -712,12 +715,12 @@
 				{
 					Username = user,
 				};
-            return new SshUserKeyCredentials()
-            {
-                Username = user,
-                PrivateKey = PrivateKeyPath,
-                PublicKey = PublicKeyPath,
-                Passphrase = "",
+			return new SshUserKeyCredentials()
+			{
+				Username = user,
+				PrivateKey = PrivateKeyPath,
+				PublicKey = PublicKeyPath,
+				Passphrase = "",
 			};
 		}


remove get list of distinct digestion params method

--- TaskLayer/MetaMorpheusTask.cs
+++ TaskLayer/MetaMorpheusTask.cs
@@ -347,26 +347,7 @@
                 }
            }
         }
-        protected static HashSet<DigestionParams> GetListOfDistinctDigestionParams(CommonParameters commonParameters, IEnumerable<CommonParameters> enumerable)
-        {
-
-            HashSet<DigestionParams> okay = new HashSet<DigestionParams>
-            {
-                commonParameters.DigestionParams
-            };
-
-            foreach (var hah in enumerable)
-            {
-                DigestionParams p = hah.DigestionParams;
-                if (okay.Contains(p)==false)
-                {
-                    okay.Add(p);
-                }
-            };
-
-            return okay;
-        }
-
+
         protected void ReportProgress(ProgressEventArgs v)
         {
             OutProgressHandler?.Invoke(this, v);


Removed class constraint on few collection generators

--- TddToolkit/Any.Collections.cs
+++ TddToolkit/Any.Collections.cs
@@ -28,7 +28,7 @@
         };
     }

-    public static IEnumerable<T> EnumerableWithout<T>(params T[] excluded) where T : class
+    public static IEnumerable<T> EnumerableWithout<T>(params T[] excluded)
     {
       var result = new List<T>
       {
@@ -44,7 +44,7 @@
       return Enumerable<T>().ToArray();
     }

-    public static T[] ArrayWithout<T>(params T[] excluded) where T : class
+    public static T[] ArrayWithout<T>(params T[] excluded)
     {
       return EnumerableWithout(excluded).ToArray();
     }


Teasers: Name length increased

Teasers: Name length increased

--- Teasers/Data/Types/ITeaser.cs
+++ Teasers/Data/Types/ITeaser.cs
@@ -16,9 +16,9 @@
     public interface ITeaser : IData
     {
         [ImmutableFieldId("0835041c-d44c-47e4-a81f-d528f5f18f89")]
-        [StoreFieldType(PhysicalStoreFieldType.String, 64)]
+        [StoreFieldType(PhysicalStoreFieldType.String, 256)]
         [NotNullValidator]
-        [StringSizeValidator(0, 64)]
+        [StringSizeValidator(0, 256)]
         string Name { get; set; }

         [ImmutableFieldId("b0dffc66-5e2b-425d-8ab5-4bfba43e8c71")]


Update size_to_string symbols in URL.cs

Update size_to_string symbols in URL.cs

The calculation works out `^2` sizes, so outputs MiB GiB, etc. It was previously outputting "MB", "GB" etc.

--- ThreadedIRCBot/Modules/URL.cs
+++ ThreadedIRCBot/Modules/URL.cs
@@ -86,7 +86,7 @@

         public static string size_to_string(Int64 byteCount)
         {
-            string[] suf = { " B", " KB", " MB", " GB", " TB", " PB", " EB" }; //Longs run out around EB
+            string[] suf = { " B", " KiB", " MiB", " GiB", " TiB", " PiB", " EiB" }; //Longs run out around EB
             if (byteCount == 0)
                 return "0" + suf[0];
             long bytes = Math.Abs(byteCount);


updated version to 0.4.0

updated version to 0.4.0

--- Mastersign.Expressions/Properties/AssemblyInfo.cs
+++ Mastersign.Expressions/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
 // übernehmen, indem Sie "*" eingeben:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.3.2.0")]
-[assembly: AssemblyFileVersion("0.3.2.0")]
+[assembly: AssemblyVersion("0.4.0.0")]
+[assembly: AssemblyFileVersion("0.4.0.0")]


Simplify with tuples

Simplify with tuples

--- MatterControlLib/SetupWizard/StagedSetupWindow.cs
+++ MatterControlLib/SetupWizard/StagedSetupWindow.cs
@@ -62,15 +62,13 @@
 				}

 				// Ensure all or only the active stage is enabled
-				foreach (var kvp in rowsByStage)
-				{
-					ISetupWizard stage = kvp.Key;
+				foreach (var (stage, widget) in rowsByStage.Select(x => (x.Key, x.Value))) // project to tuple - deconstruct to named items
+				{
 					bool isActiveStage = stage == value;
 					bool noActiveStage = value == null;

 					// Enable GuiWidget when no stage is active or when the current stage is active and enabled
-					var widget = kvp.Value;
-					widget.Enabled = noActiveStage || isActiveStage;
+					widget.Enabled = stage.Enabled && (noActiveStage || isActiveStage);
 				}

 				// Shutdown the active Wizard


Revert "Sort by organization id then name when getting projects. "

This reverts commit f3456485dd55f3cfa672ec99f5fdc4e3262b4b91.


Fix FileExists -> DirectoryExists in ConfigurationProvider


[Covalence] Return hostname instead of identity

--- Oxide.Game.Rust/Libraries/Covalence/RustServer.cs
+++ Oxide.Game.Rust/Libraries/Covalence/RustServer.cs
@@ -19,7 +19,7 @@
         {
             get
             {
-                return Server.identity;
+                return Server.hostname;
             }
         }


Add registry entries for all appropriate application types


update ldap to use specific node

update ldap to use specific node

per tom poague

--- Purchasing.Web/Services/DirectorySearchService.cs
+++ Purchasing.Web/Services/DirectorySearchService.cs
@@ -41,7 +41,7 @@
         private static readonly string LDAPUser = WebConfigurationManager.AppSettings["LDAPUser"];
         private static readonly int STR_LDAPPort = 636;
         private static readonly string STR_LDAPURL = "ldap.ucdavis.edu";
-        private static readonly string STR_LDAPIP = "128.120.32.63";
+        private static readonly string STR_LDAPIP = "128.120.32.44"; //specific node per T.Poage //"128.120.32.63";

         public static SearchResponse GetSearchResponse(string searchFilter, string searchBase, int sizeLimit = 500)
         {


Also wait for completion of down scripts

--- RavenMigrations/Migrations/IndexPatchMigration.cs
+++ RavenMigrations/Migrations/IndexPatchMigration.cs
@@ -52,7 +52,8 @@
                 new ScriptedPatchRequest
                 {
                     Script = DownPatch
-                });
+                })
+                .WaitForCompletion();
         }
     }
 }


Move ContinueButton translation to #region General expressions; Refer to that translation in all other occurences of "just a continue button" across the app;

--- RelhaxModpack/RelhaxModpack/Utils/Translations.cs
+++ RelhaxModpack/RelhaxModpack/Utils/Translations.cs
@@ -592,6 +592,16 @@
             Spanish.Add("next", "Siguiente");
             Russian.Add("next", "Далее");

+            //Component: ContinueButton
+            // Continue button used in many places (at least this particular translation of it).
+            // LIST: DiagnosticsContinueButton; ExportContinueButton; SelectLanguagesContinueButton;
+            English.Add("ContinueButton", "Continue");
+            German.Add("ContinueButton", "Fortsetzen");
+            Polish.Add("ContinueButton", "Kontynuuj");
+            French.Add("ContinueButton", "Continuer");
+            Spanish.Add("ContinueButton", "Continuar");
+            Russian.Add("ContinueButton", "Продолжить");
+
             //Component: previous
             //
             English.Add("previous", "Previous");
@@ -3882,7 +3892,7 @@
             Russian.Add("AddPicturesZip", TranslationNeeded);

             //Component: DiagnosticsAddSelectionsPicturesLabel
-            //the message when the UISettings.xml file is parsed and the custom theme is loaded
+            //
             English.Add("DiagnosticsAddSelectionsPicturesLabel", "Add any additional files here (your selection file, picture, etc.)");
             German.Add("DiagnosticsAddSelectionsPicturesLabel", "Füge zusätzliche Dateien hinzu (deine Auswahldatei, Bilder, etc.)");
             Polish.Add("DiagnosticsAddSelectionsPicturesLabel", "Dodaj wszelkie dodatkowe pliki (plik kolekcji, obrazy, itp.)");
@@ -3891,7 +3901,7 @@
             Russian.Add("DiagnosticsAddSelectionsPicturesLabel", "Добавить какие-либо дополнительные файлы (файл предустановки, изображения, и т. д.)");

             //Component: DiagnosticsAddFilesButton
-            //the message when the UISettings.xml file is parsed and the custom theme is loaded
+            //
             English.Add("DiagnosticsAddFilesButton", "Add Files");
             German.Add("DiagnosticsAddFilesButton", "Dateien hinzufügen");
             Polish.Add("DiagnosticsAddFilesButton", "Dodaj pliki");
@@ -3900,7 +3910,7 @@
             Russian.Add("DiagnosticsAddFilesButton", "Добавить файлы");

             //Component: DiagnosticsRemoveSelectedButton
-            //the message when the UISettings.xml file is parsed and the custom theme is loaded
+            //
             English.Add("DiagnosticsRemoveSelectedButton", "Remove Selected");
             German.Add("DiagnosticsRemoveSelectedButton", "Entferne Ausgewähltes");
             Polish.Add("DiagnosticsRemoveSelectedButton", "Usuń zaznaczone");
@@ -3909,13 +3919,13 @@
             Russian.Add("DiagnosticsRemoveSelectedButton", "Удалить выбранное");

             //Component: DiagnosticsContinueButton
-            //the message when the UISettings.xml file is parsed and the custom theme is loaded
-            English.Add("DiagnosticsContinueButton", "Continue");
-            German.Add("DiagnosticsContinueButton", "Fortsetzen");
-            Polish.Add("DiagnosticsContinueButton", "Kontynuuj");
-            French.Add("DiagnosticsContinueButton", TranslationNeeded);
-            Spanish.Add("DiagnosticsContinueButton", "Continuar");
-            Russian.Add("DiagnosticsContinueButton", "Продолжить");
+            //
+            English.Add("DiagnosticsContinueButton", English["ContinueButton"]);
+            German.Add("DiagnosticsContinueButton", German["ContinueButton"]);
+            Polish.Add("DiagnosticsContinueButton", Polish["ContinueButton"]);
+            French.Add("DiagnosticsContinueButton", French["ContinueButton"]);
+            Spanish.Add("DiagnosticsContinueButton", Spanish["ContinueButton"]);
+            Russian.Add("DiagnosticsContinueButton", Russian["ContinueButton"]);

             //Component: cantRemoveDefaultFile
             //
@@ -4401,15 +4411,6 @@
             French.Add("AgreementAnonData", "Je comprends que Relhax V2 collecte des données d'utilisation anonymes pour améliorer l'application, et peut être désactivé dans les options avancées");
             Spanish.Add("AgreementAnonData", "Comprendo que Relhax V2 recoge datos anónimos de uso para mejorar la aplicación, lo cual puede ser deshabilitado en la pestaña de opciones avanzadas");
             Russian.Add("AgreementAnonData", "Я понимаю, что Relhax V2 собирает анонимные сведения об использовании для улучшения приложения и могу отключить сбор данных в разделе расширенных настроек");
-
-            //Component: ContinueButton
-            // Just a continue button on the bottom. Proceeds to the main application if everything is selected.
-            English.Add("ContinueButton", "Continue");
-            German.Add("ContinueButton", "Fortsetzen");
-            Polish.Add("ContinueButton", "Kontynuuj");
-            French.Add("ContinueButton", "Continuer");
-            Spanish.Add("ContinueButton", "Continuar");
-            Russian.Add("ContinueButton", "Продолжить");

             //Component: V2UpgradeNoticeText
             // A text block appearing (in red) under the last acknowledgement, centered in the window - only if the app detects that a conversion is required.
@@ -4465,12 +4466,12 @@

             //Component: ExportContinueButton
             //
-            English.Add("ExportContinueButton", "Continue");
-            German.Add("ExportContinueButton", "Fortfahren");
-            Polish.Add("ExportContinueButton", "Kontynuuj");
-            French.Add("ExportContinueButton", TranslationNeeded);
-            Spanish.Add("ExportContinueButton", "Continuar");
-            Russian.Add("ExportContinueButton", "Продолжить");
+            English.Add("ExportContinueButton", English["ContinueButton"]);
+            German.Add("ExportContinueButton", German["ContinueButton"]);
+            Polish.Add("ExportContinueButton", Polish["ContinueButton"]);
+            French.Add("ExportContinueButton", French["ContinueButton"]);
+            Spanish.Add("ExportContinueButton", Spanish["ContinueButton"]);
+            Russian.Add("ExportContinueButton", Russian["ContinueButton"]);

             //Component: ExportCancelButton
             //


GitHubSync update

GitHubSync update

--- deployment/cake/generic-variables.cake
+++ deployment/cake/generic-variables.cake
@@ -343,8 +343,6 @@
         ConfigurationName = buildContext.BuildServer.GetVariable("ConfigurationName", "Release", showValue: true)
     };

-    data.RootDirectory = System.IO.Path.GetFullPath(".");
-    data.OutputRootDirectory = System.IO.Path.GetFullPath(buildContext.BuildServer.GetVariable("OutputRootDirectory", string.Format("./output/{0}", data.Solution.ConfigurationName), showValue: true));
     data.IsCiBuild = buildContext.BuildServer.GetVariableAsBool("IsCiBuild", false, showValue: true);
     data.IsAlphaBuild = buildContext.BuildServer.GetVariableAsBool("IsAlphaBuild", false, showValue: true);
     data.IsBetaBuild = buildContext.BuildServer.GetVariableAsBool("IsBetaBuild", false, showValue: true);
@@ -360,6 +358,10 @@
         data.Solution.ConfigurationName = "Debug";
     }

+    // Important: do *after* initializing the configuration name
+    data.RootDirectory = System.IO.Path.GetFullPath(".");
+    data.OutputRootDirectory = System.IO.Path.GetFullPath(buildContext.BuildServer.GetVariable("OutputRootDirectory", string.Format("./output/{0}", data.Solution.ConfigurationName), showValue: true));
+
     data.SourceLink = new SourceLinkContext(data)
     {
         IsDisabled = buildContext.BuildServer.GetVariableAsBool("SourceLinkDisabled", false, showValue: true)


basic functionality

basic functionality

--- Samples.CSharp7/Source/CSharp7.DemoApp/Program.cs
+++ Samples.CSharp7/Source/CSharp7.DemoApp/Program.cs
@@ -80,8 +80,29 @@
             ForegroundColor = ConsoleColor.Yellow;

             WriteLine($"Reapted String");
+
+            Write($"Enter a String [For searching a]");
             var inputString = ReadLine();
-            WriteLine($"{inputString.Count(f => f == 'a')}");
+            Write($"Enter The Length: ");
+            long n = Convert.ToInt64(Console.ReadLine());
+            bool charFound = false;
+            long count = 0;
+
+            // WriteLine($"{inputString.Count(f => f == 'a')}");
+            long toTraverse = (inputString.Length <= n) ? inputString.Length : n;
+            for(int iCtr=0; iCtr<toTraverse; iCtr++)
+            {
+                if(inputString[iCtr] == 'a')
+                {
+                    count++;
+                }
+            }
+
+            if(inputString.Length <= n)
+            {
+                count = (n / inputString.Length) * count;
+            }
+            WriteLine($"a found {count} times");

             new ShowLogicDemos()
                 .JumpingOnTheCloudsDemo()


Improve GetDerivedInstances to log a message instead of throwing exception #651

- added anchor

--- SemanticData/UANodeSetValidation/UANodeContext.cs
+++ SemanticData/UANodeSetValidation/UANodeContext.cs
@@ -95,6 +95,8 @@
           case ReferenceKindEnum.Custom:
           case ReferenceKindEnum.HasComponent:
           case ReferenceKindEnum.HasProperty:
+          //NetworkIdentifier is missing in generated Model Design for DI model #629
+          case ReferenceKindEnum.HierarchicalReferences:
             break;

           case ReferenceKindEnum.HasModellingRule:
@@ -194,7 +196,7 @@
           case ReferenceKindEnum.HierarchicalReferences:
             //TODO NetworkIdentifier is missing in generated Model Design for DI model #629
             XmlQualifiedName referenceType = _rfx.GetReferenceTypeName();
-            string message =
+            string message =
               $"Id = D290E7B4-F77C-4EF0-883B-844F66471DB6; Reference {nameof(ReferenceKindEnum.HierarchicalReferences)} is not supported. Removed the graph at {referenceType.ToString()} of nodes from the model";
             _TraceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.DiagnosticInformation, message));
             break;
@@ -285,6 +287,7 @@
     public Dictionary<string, IUANodeBase> GetDerivedInstances()
     {
       if (m_InGetDerivedInstances)
+        //Improve GetDerivedInstances to log a message instead of throwing exception #651
         throw new ArgumentOutOfRangeException($"Circular loop in {nameof(GetDerivedInstances)}"); //TODO replace by the message - it is just model error.
       try
       {


deleted unused file

deleted unused file

--- Sensus.Shared/Probes/KeepDeviceAwakeConditions.cs
+++ Sensus.Shared/Probes/KeepDeviceAwakeConditions.cs
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Sensus.Probes
-{
-	// this was added as a potential refactor to how ListeningProbe.KeepDeviceAwake worked,
-	public enum KeepDeviceAwakeConditions
-	{
-		Never,
-		OnAcPower,
-		Always
-	}
-}


scriptrunner - has submitted refactor

scriptrunner - has submitted refactor

--- Sensus.Shared/Probes/User/Scripts/ScriptRunner.cs
+++ Sensus.Shared/Probes/User/Scripts/ScriptRunner.cs
@@ -611,6 +611,7 @@
 		public async Task ResetAsync()
 		{
 			await UnscheduleCallbacksAsync();
+			HasSubmitted = false;
 			RunTimes.Clear();
 			CompletionTimes.Clear();
 		}


Add PendingHistoricalRequests and RealTimeDataStreams to IDataClient

--- QDMSClient/IDataClient.cs
+++ QDMSClient/IDataClient.cs
@@ -7,6 +7,7 @@
 using QDMSClient;
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq.Expressions;
 using System.Threading.Tasks;

@@ -24,6 +25,16 @@
         bool Connected { get; }

         /// <summary>
+        /// Keeps track of historical requests that have been sent but the data has not been received yet.
+        /// </summary>
+        ObservableCollection<HistoricalDataRequest> PendingHistoricalRequests { get; }
+
+        /// <summary>
+        /// Keeps track of live real time data streams.
+        /// </summary>
+        ObservableCollection<RealTimeDataRequest> RealTimeDataStreams { get; }
+
+        /// <summary>
         /// Add a new exchange
         /// </summary>
         Task<ApiResponse<Exchange>> AddExchange(Exchange exchange);


修改 ToChineseRMB

修改 ToChineseRMB

--- ToolGood.Words/WordsHelper.cs
+++ ToolGood.Words/WordsHelper.cs
@@ -260,6 +260,7 @@
         /// <returns></returns>
         public static string ToChineseRMB(double x)
         {
+            if (x == 0.0) { return "零元"; }
             string s = x.ToString("#L#E#D#C#K#E#D#C#J#E#D#C#I#E#D#C#H#E#D#C#G#E#D#C#F#E#D#C#.0B0A");
             string d = Regex.Replace(s, @"((?<=-|^)[^1-9]*)|((?'z'0)[0A-E]*((?=[1-9])|(?'-z'(?=[F-L\.]|$))))|((?'b'[F-L])(?'z'0)[0A-L]*((?=[1-9])|(?'-z'(?=[\.]|$))))", "${b}${z}");
             return Regex.Replace(d, ".", m => "负元空零壹贰叁肆伍陆柒捌玖空空空空空空空分角拾佰仟萬億兆京垓秭穰"[m.Value[0] - '-'].ToString());