image
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" encoding="utf-8"?> | |
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<settings pass="offlineServicing"> | |
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> | |
<ComputerName>NanoServer</ComputerName> | |
</component> | |
</settings> | |
<settings pass="oobeSystem"> | |
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> | |
<UserAccounts> |
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
<SyntaxDefinition name="SQL" extensions=".sql" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008"> | |
<Color name="Digits" foreground="#FF00008B" exampleText="3.1415f" /> | |
<Color name="Comment" foreground="#FF008000" exampleText="string text = "Hello, World!"" /> | |
<Color name="Punctuation" foreground="#FFFF0000" exampleText="string text = "Hello, World!"" /> | |
<Color name="String" foreground="#FF808000" exampleText="string text = "Hello, World!"" /> | |
<Color name="String2" foreground="#FF999933" exampleText="string text = "Hello, World!"" /> | |
<Color name="Keyword" foreground="#FF0000FF" fontWeight="bold" exampleText="SELECT" /> | |
<Color name="MethodCall" foreground="#FF191970" fontWeight="bold" /> | |
<Color name="ObjectReference" foreground="#FF008080" exampleText="Customer.Name" /> | |
<Color name="CommentMarkerSetTodo" foreground="#FFFF0000" fontWeight="bold" /> |
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 ICSharpCode.AvalonEdit; | |
using System; | |
using System.Windows; | |
namespace AvalonEditSample | |
{ | |
public class BindableEditor : TextEditor | |
{ | |
public BindableEditor() | |
{ |
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
string ToBitDoubleString(double num) | |
{ | |
return BitConverter.GetBytes(num) | |
.Reverse() // little endian -> big endian | |
.SelectMany(x => x.ToString("X2")) //to x16 char | |
.Select(x => Convert.ToString(Convert.ToInt32($"{x}", 16), 2).PadLeft(4, '0')) // to x2 | |
.Aggregate("", (x, y) => x + y); | |
} | |
double ToDouble(string str) |
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
$path = "HKLM:\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters"; | |
Set-ItemProperty -path $path -name "LayerDriver JPN" -type string -value "kbd106.dll" | |
Set-ItemProperty -path $path -name "OverrideKeyboardIdentifier" -type string -value "PCAT_106KEY" | |
Set-ItemProperty -path $path -name "OverrideKeyboardSubtype" -type DWord -value 2 | |
Set-ItemProperty -path $path -name "OverrideKeyboardType" -type DWord -value 7 | |
Get-ItemProperty $path |
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.Generic; | |
namespace Test20160912 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var inputs = new[] { "((1 + 4) * (3 + 7) / 5)", "((1 - 7) / (7 - 5)) * 5", "", "1+2" }; |
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
ls | ?{!$_.PSIsContainer} | Unblock-File |
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
int GetGcd(int a, int b) | |
{ | |
if (a < b) return GetGcd(b, a); | |
int tmp = 0; | |
do | |
{ | |
tmp = a % b; | |
a = b; | |
b = tmp; | |
} while (tmp != 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
public string ToRadixString(int num, int radix) | |
{ | |
if (num == 0) return "0"; | |
var list = new List<string>(); | |
var tmp = num; | |
while (0 < tmp) | |
{ | |
var digit = tmp % radix; | |
tmp = tmp / radix; | |
list.Add(digit.ToString()); |
NewerOlder