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
<Application xmlns="https://github.com/avaloniaui" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
x:Class="AvaloniaApplication1.App" | |
RequestedThemeVariant="Default"> | |
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> | |
<Application.Styles> | |
<FluentTheme /> | |
<!-- Added OxyPlot styles --> | |
<StyleInclude Source="avares://OxyPlot.Avalonia/Themes/Default.axaml"/> |
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 class NoTransition : IPageTransition | |
{ | |
public Task Start(Visual from, Visual to, bool forward, CancellationToken cancellationToken) | |
{ | |
if (from is not null) | |
{ | |
from.IsVisible = false; | |
} | |
if (to is not null) |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="NAudio" Version="1.10.0" /> |
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
// this would be a shape/concept/whatever, not an interfae | |
interface ICommutativeOrdinalThing<T> | |
{ | |
/// <summary> | |
/// Commutative addition of things | |
/// </summary> | |
T Add(T a, T b); // with proposal, might pick up + | |
/// <summary> | |
/// Comparision of the strictly orderable things |
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 static Rectangle GetBrightestRectangle(this Bitmap bitmap, int width, int height) | |
{ | |
// Each rectangle's value is its average pixel color. | |
var rectangles = new Dictionary<Rectangle, float>(); | |
// Iterate through all possible rectangle points. | |
for (var x = 0; x < bitmap.Width - width; x++) | |
for (var y = 0; y < bitmap.Height - height; y++) | |
{ | |
var brightnesses = new List<float>(); |
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.Text; | |
using System.Threading.Tasks; | |
using System.Net.Sockets; | |
namespace NetTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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 model = new PlotModel { Title = "PNG Rendering" }; | |
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left }); | |
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom }); | |
model.Series.Add(new FunctionSeries(x => x * x, 0, 1, 1000)); | |
// export as PNG | |
var pngExporter = new OxyPlot.WindowsForms.PngExporter(); | |
using (var fs = System.IO.File.Open("test.png", System.IO.FileMode.Create)) |
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 model = new PlotModel { Title = "SVG Text Rendering" }; | |
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left }); | |
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom }); | |
model.Annotations.Add(new OxyPlot.Annotations.TextAnnotation() | |
{ | |
Text = "A", | |
TextPosition = new DataPoint(10, 80), | |
TextVerticalAlignment = VerticalAlignment.Bottom, | |
}); |
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
Required Effort: 108 | |
Probability of Success: 0.37527553125 | |
Step Right | |
Step Right | |
Step Right | |
Step Right | |
Drop | |
Drop | |
Step Right | |
Step Right |
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
# Can used with test.ps1 | |
# > . .\test.ps1 chrisstrap.ps1 | |
# Expects perl (5) to be installed, and chris.pl to be in the current directory | |
# | |
# You can investigate issues by first writing the solution to a file... | |
# > type .\testcase0.txt | . .\chrisstrap.ps1 > chrissol0.txt | |
# ... and then feeding it to OfficeEscapeSolver.exe | |
# > type .\testcase0.txt | . .\OfficeEscapeSolver.exe * .\chrissol0.txt | |
# Which will (hopefully) provide helpful information |
NewerOlder