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
Reliable systems must hanlde conflicting information. | |
The problem is slovable if and only if more than two-thirds loyal generals. | |
If messages unforgeable, the problem is solvable for any number of generals. | |
The algorithm must guarantee: | |
A. All royal generals decide upon the same plan of action. | |
B. A small number of traitors cannot cause the loyal generals to adpot a bad plan. |
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
It uses only one message round trip to execute read-only operations and two to execute read-write operations. | |
Survives in asynchronous networks. | |
Messages contain public-key signatures, message authentication codes, and message digests produced by collision-resistant hash functions. | |
<m>sign(i): message m signed by node i. | |
D(m): digest of message m. |
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
NEO_VERSION=2.7.5 | |
NEO_DOWNLOAD_URL=https://github.com/neo-project/neo-cli/releases/download/v$NEO_VERSION/neo-cli-linux-x64.zip | |
NEO_BLOCK_URL=http://static.neo.org/client/chain.acc.test.zip | |
# dotnet | |
sudo apt-get install apt-transport-https | |
sudo apt-get update | |
sudo apt-get install dotnet-sdk-2.1.200 | |
# neo-cli deps |
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
op_5 OP_TOALTSTACK | |
0 OP_TOALTSTACK | |
OP_FROMALTSTACK | |
OP_FROMALTSTACK | |
OP_DUP | |
3 OP_PICK | |
OP_1ADD | |
OP_SWAP | |
OP_TOALTSTACK |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<canvas id="canvas"></canvas> | |
<button id="start">START</button> |
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
// A tool for creating new deno project. | |
// | |
// Download this file, then add `alias bone="deno -A bone.ts"` to your ~/.bashrc. | |
// | |
// Usage: bone [task] | |
// | |
// Examples: | |
// | |
// bone new PATH - Creates a new deno project at the given 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
defmodule Aliyunmail do | |
@url "https://dm.ap-southeast-1.aliyuncs.com" | |
@access_key_id "LTAIBXtSnSsfyHPB" | |
@secret "xxxxx&" | |
def send_mail(to_address, html_body) do | |
unsigned = %{ | |
"Action" => "SingleSendMail", |
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
defmodule Rainbow do | |
@moduledoc """ | |
Documentation for Rainbow. | |
""" | |
@colors ~w(赤 橙 黄 绿 青 蓝 紫) | |
def start do | |
node = spawn(fn -> | |
loop([]) |
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
const FundamentalObjects = [ | |
Object, | |
Function, | |
Boolean, | |
Symbol, | |
Error | |
] | |
const NumbersAndDates = [ | |
Number, |
OlderNewer