View MainPage.xaml
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
<Page x:Class="UnoApp8.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:local="using:UnoApp8" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | |
mc:Ignorable="d"> | |
<Grid> |
View StringConcatSimple.cs
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
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Columns; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Running; | |
using BenchmarkDotNet.Samples; | |
using System; | |
using System.Text; | |
//var s = new StringConcatSimple(); | |
//Console.WriteLine(s.StringInterpolation()); |
View settings.json
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
{ | |
"$help": "https://aka.ms/terminal-documentation", | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"actions": | |
[ | |
{ | |
"command": | |
{ | |
"action": "closeTab" | |
}, |
View RefStructProblem.cs
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
var line = new Line(new PointStruct(1, 2), new PointStruct(3, 4)); | |
line.Start.Swap(); | |
Console.WriteLine(line); | |
record struct Line { | |
private ref PointStruct _start; | |
private ref PointStruct _stop; | |
public ref PointStruct Start => ref _start; |
View PrimesCounter.razor
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
<h1>Primes Counter</h1> | |
<p>@_output</p> | |
<button class="btn btn-primary" @onclick="CountPrimesSingleThreaded">Single Threaded</button> | |
<button class="btn btn-primary" @onclick="CountPrimesMultiThreaded">Multi Threaded</button> | |
@code { | |
private string _output = "Not yet executed"; | |
private void CountPrimesSingleThreaded() { | |
int total = 0; |
View ForEachRef.cs
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
var l = new List<PointStruct>() { | |
new PointStruct(1, 10), | |
new PointStruct(2, 20), | |
new PointStruct(3, 30), | |
}; | |
var a = l.ToArray(); | |
l.ForEachRef(static (ref PointStruct p) => p.Swap()); |
View Grid.cs
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
using System; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Markup; | |
namespace ReflectionIT.Universal.Helpers { | |
/// <summary> | |
/// <Grid helpers:Grid.RowDefinitions="1*, 50, Auto,2*" | |
/// helpers:Grid.ColumnDefinitions="1.5*,50,Auto,2.5*" ... | |
/// </summary> |
View IsPrime.cs
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
var sw = System.Diagnostics.Stopwatch.StartNew(); | |
int total = 0; | |
for (int i = 1; i <= 20_000_000; i++) { | |
if (IsPrime(i)) { | |
total++; | |
} | |
} | |
sw.Stop(); | |
Console.WriteLine($"{total} in {sw.Elapsed} sec"); |
View RecordStructBenchmark.cs
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
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System; | |
namespace RecordStructBM { | |
class Program { | |
static void Main(string[] args) { | |
BenchmarkRunner.Run<BM>(); | |
} | |
} |
View SieveOfEratosthenesDemo.cs
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
using System; | |
using System.Collections; | |
using static System.Console; | |
int start = 1, end = 1000; | |
WriteLine($"The prime numbers between {start} and {end} are :"); | |
BitArray bits = SieveOfEratosthenes(end); | |
for (int i = start; i <= end; i++) | |
{ |
NewerOlder