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
Func<(int, int), (int, int), bool> inCheck = (q1, q2) => q1.Item1 == q2.Item1 || q1.Item2 == q2.Item2 || Math.Abs(q1.Item1 - q2.Item1) == Math.Abs(q1.Item2 - q2.Item2); | |
Func<(int, int), IEnumerable<(int, int)>, bool> isSafe = (queen, queens) => queens.All(q => !inCheck(queen, q)); | |
Func<int, IEnumerable<IEnumerable<(int, int)>>> queens = n => { | |
Func<int, IEnumerable<IEnumerable<(int, int)>>> placeQueens = null; | |
placeQueens = k => { | |
if (k == 0){ | |
return Enumerable.Repeat(Enumerable.Empty<(int, int)>(), 1); | |
} else { |
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
@fsi --exec %HOME%\bin\Clip_URLShortcut.fsx %* | clip | |
@pause |
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>netcoreapp1.1</TargetFramework> | |
<RootNamespace>App</RootNamespace> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.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
:: 管理者として実行する | |
robocopy C:\Source D:\Destination /E /R:0 /W:0 /NP /XJ /LOG:logfile.txt |
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
$ip = (invoke-webrequest http://169.254.169.254/latest/meta-data/public-ipv4 -UseBasicParsing).content | |
$zoneId = "/hostedzone/[id]" | |
$name = "abc.example.com." | |
Import-Module AWSPowerShell | |
$c = new-object Amazon.Route53.Model.Change | |
$c.Action = "UPSERT" | |
$c.ResourceRecordSet = new-object Amazon.Route53.Model.ResourceRecordSet | |
$c.ResourceRecordSet.Name = $name | |
$c.ResourceRecordSet.Type = "A" |
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
$source = "なまえ" | |
if([System.Diagnostics.Eventlog]::SourceExists($source) -eq $false) | |
{ | |
New-Eventlog -Logname Application -Source $source | |
} | |
Write-Eventlog -LogName Application -Source $source -EntryType Error -EventId 1 -Message "message" |
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
&(Read-S3Object -BucketName "bucketName" -Key "file.ps1" -File ([io.path]::GetRandomFileName() + ".ps1")) |
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
net user administrator "password" |
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; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web; | |
namespace WebApplication1 | |
{ | |
public class Run : HttpTaskAsyncHandler |
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
netsh advfirewall firewall set rule name="Windowsリモート管理(HTTP受信)",profile=public new remoteip=any |