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
{ | |
"alpha:username": "admin", | |
"alpha:password": "password", | |
"alpha:encryption-type": "Cisco-Type7" | |
} |
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
/* | |
IPv4 addresses are 32-bit unsigned integers, that are commonly | |
represented in "dotted decimal notation". | |
Dotted decimal notation takes each 8-bit byte of the IP address, | |
displays them in base 10, and separates them with a decimal point. | |
10.100.30.52 | |
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
<?xml version="1.0"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="/Bridge"> | |
<html> | |
<body> | |
<h2><xsl:value-of select="Name"/></h2> | |
<h4>Bridge Properties</h4> | |
<ul> | |
<li>Number of Spans: <xsl:value-of select="NumSpans"/></li> |
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 readonly struct OneVarInterpolationPoint | |
: IComparable<OneVarInterpolationPoint>, | |
IComparable<decimal>, | |
IComparable, | |
IEquatable<OneVarInterpolationPoint>, | |
IEquatable<decimal> | |
{ | |
public OneVarInterpolationPoint(decimal var, decimal result) | |
{ |
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 PhoneNumber Parse(string text) | |
{ | |
var match = Regex.Match(text, @"^\(((?<areaCode>\d{3})\)\s*)?(?<exchange>\d{3})-(?<number>\d{4})$"); | |
var areaCode = string.IsNullOrWhiteSpace(match.Groups["areaCode"].Value) | |
? null | |
: (int?)int.Parse(match.Groups["areaCode"].Value); | |
var exchange = int.Parse(match.Groups["exchange"].Value); | |
var number = int.Parse(match.Groups["number"].Value); | |
if (areaCode is < 0 or > 999) | |
throw new Exception("Area code is invalid"); |
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.Diagnostics.CodeAnalysis; | |
public struct BitVector<T> | |
: IBitVector<BitVector<T>, T>, | |
IEquatable<T>, IEqualityOperators<BitVector<T>, T> | |
where T : IEquatable<T>, | |
IBitwiseOperators<T, T, T>, | |
IShiftOperators<T, T>, | |
IMinMaxValue<T>, | |
IBinaryInteger<T>, |
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.Windows.Input; | |
using CommunityToolkit.Mvvm.Input; // https://www.nuget.org/packages/CommunityToolkit.Mvvm | |
public class CustomCommand<T> : IRelayCommand<T> | |
{ | |
private readonly Action<T?> execute; | |
private readonly Predicate<T?>? canExecute; | |
public CustomCommand(Action<T?> execute, Predicate<T?>? canExecute = 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>WinExe</OutputType> | |
<TargetFramework>net6.0</TargetFramework> | |
<PublishReadyToRun>false</PublishReadyToRun> | |
<TieredCompilation>false</TieredCompilation> | |
<Nullable>enable</Nullable> | |
<WarnOn>3390;$(WarnOn)</WarnOn> | |
<LangVersion>preview</LangVersion> |
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 sealed class RelativeFontSizeHelper | |
{ | |
public static readonly DependencyProperty RelativeFontSizeProperty = DependencyProperty.RegisterAttached( | |
"RelativeFontSize", | |
typeof(double), | |
typeof(RelativeFontSizeHelper), | |
new ((double)0, RelativeFontSizeChanged) | |
); | |
public static double GetRelativeFontSize(TextBlock textBlock) |