These are my personal notes from reading up on Quantum Computing. There's a great series of posts here, including a more comprehensive cheat sheet that you should probably use instead!
Using (a,b) to represent the column vector: (a)
These are my personal notes from reading up on Quantum Computing. There's a great series of posts here, including a more comprehensive cheat sheet that you should probably use instead!
Using (a,b) to represent the column vector: (a)
[reflection.assembly]::loadfile( "C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Drawing.dll") | |
function BytesToString($bytes) { | |
return [System.Text.Encoding]::ASCII.GetString($bytes) | |
} | |
function StringToBytes($string) { | |
return [System.Text.Encoding]::ASCII.GetBytes($string) | |
} | |
function GetImageTakenDate($filename) { |
[core] | |
editor = code --wait | |
[diff] | |
tool = default-difftool | |
[difftool "default-difftool"] | |
cmd = code --wait --diff $LOCAL $REMOTE | |
[alias] | |
amendcommit = "!git commit --amend --reuse-message \"$(git rev-parse --abbrev-ref HEAD)\"" | |
branches = branch -a --color -v | |
wip = !git add -A && git commit -qm "WIP" |
using Microsoft.ApplicationInsights.Channel; | |
using Microsoft.ApplicationInsights.Extensibility; | |
using System.Collections.Generic; | |
using System.Web; | |
namespace AppInsightsHeaders | |
{ | |
public class HeaderTelemetryInitializer : ITelemetryInitializer | |
{ | |
public List<string> RequestHeaders { get; set; } |
{"lastUpload":"2020-06-24T08:12:00.857Z","extensionVersion":"v3.4.3"} |
function Get-KeyState([uint16]$keyCode) | |
{ | |
$signature = '[DllImport("user32.dll")]public static extern short GetKeyState(int nVirtKey);' | |
$type = Add-Type -MemberDefinition $signature -Name User32 -Namespace GetKeyState -PassThru | |
return [bool]($type::GetKeyState($keyCode) -band 0x80) | |
} | |
$VK_SHIFT = 0x10 | |
function OutputStatus($message){ | |
try { | |
[Console]::SetCursorPosition(0,0) |
function OutputStatus($message){ | |
try { | |
[Console]::SetCursorPosition(0,0) | |
Write-Host $message.PadRight([Console]::BufferWidth) | |
} | |
catch [System.IO.IOException] { | |
## IO Exception when unable to set position | |
} | |
} | |
$messages = @() |
param( | |
[parameter(Mandatory=$true, ValueFromPipeline)] | |
[object[]] $blobs, | |
[parameter()] | |
$uiDefinitionFilename = "createUiDefinition.json" | |
) | |
process{ | |
$uiBlob = $blobs | ?{ $_.Name -eq $uiDefinitionFilename} | select -First 1 | |
if ($uiBlob -ne $null){ |
get-command Get* | %{ set-alias -name ($_ -replace "^Get","Gert") -Value $_ } |
param( | |
$templateFile, | |
[switch] $includeParametersWithDefaults | |
) | |
$template = Get-Content $templateFile | ConvertFrom-Json | |
function getDefaultValue($type){ | |
switch ($type){ | |
"bool" {'false'} | |
"int" {0} |