This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// rearranges the elements into a sequence of element sets where no set has the same elements as another | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="c"></param> | |
/// <param name="size"></param> | |
/// <returns></returns> | |
public static IEnumerable<IEnumerable<T>> CombineDistinct<T>(this IEnumerable<T> c, int size) | |
{ | |
return c.ReArrange(new Kaos.Combinatorics.Combination(c.Count(), size).EnumerateDistinct()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nullable enable | |
using OxyPlot; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reactive.Linq; | |
using OxyPlot.Series; | |
namespace OxyPlotEx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appSettings vs. applicationSettings in C# | |
https://bauermalzwei.de/2019/01/03/appsettings-vs-applicationsettings-in-c/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async void btnStart_Click(object sender, RoutedEventArgs e) | |
{ | |
var syncContext = SynchronizationContext.Current; | |
lblStatus.Text = "Working..."; | |
// non blocking call | |
var data = await GetDataFromRemoteServerAsync().ConfigureAwait(false); | |
// blocking call, but runs on a worker thread | |
DoSomeCpuBoundWorkWithTheData(data); | |