_ _ _ ____ ____ ____
| \ | | _____ _| |_| __ ) ___|| _ \
| \| |/ _ \ \/ / __| _ \___ \| | | |
| |\ | __/> <| |_| |_) |__) | |_| |
|_| \_|\___/_/\_\\__|____/____/|____/
``` `
s` `.....---.......--.``` -/
This file contains hidden or 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
#include <math.h> | |
#include <algorithm> | |
#include <string> | |
#include <immintrin.h> | |
using namespace std;typedef float R; | |
#define _W 79 | |
#define _H 39 | |
#define EP 0.01f | |
#define OP operator | |
#define C const |
This file contains hidden or 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
# Original Source: | |
# https://gist.github.com/ggrandes/a57c401f1bad6bd0ffd87a557b7b5790 | |
# SIGN / VERIFY | |
openssl cms -sign -keyid -md sha256 -nodetach -binary -in /etc/passwd -signer user.crt -inkey user.key -out x.smime -outform SMIME | |
openssl cms -verify -CAfile ca.crt -in x.smime -inform SMIME | |
# ENCRYPT / DECRYPT | |
openssl cms -encrypt -keyid -aes-256-cbc -in /etc/passwd -binary -out x.smime -outform SMIME user.crt | |
openssl cms -decrypt -in x.smime -inform SMIME -recip user.crt -inkey user.key |
This file contains hidden or 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
predicate sorted(a: array<int>) | |
requires a != null; | |
reads a; | |
{ | |
forall j,k :: 0 <= j < k < a.Length ==> a[j] <= a[k] | |
} | |
predicate sortedPart(a: array<int>, n : int) | |
requires a != null; | |
requires n <= a.Length; |
This file contains hidden or 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
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
Your blockchain must have all of the following properties:
- It's a merkle tree, or a construct with equivalent properties.
- There is no single point of trust or authority; nodes are operated by different parties.
- Multiple 'forks' of the blockchain may exist - that is, nodes may disagree on what the full sequence of blocks looks like.
- In the case of such a fork, there must exist a deterministic consensus algorithm of some sort to decide what the "real" blockchain looks like (ie. which fork is "correct").
- The consensus algorithm must be executable with only the information contained in the blockchain (or its forks), and no external input (eg. no decisionmaking from a centralized 'trust node').
If your blockchain is missing any of the above properties, it is not a blockchain, it is just a ledger.
This file contains hidden or 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
{-# OPTIONS --copatterns #-} | |
module Main where | |
-- A simple cat program which echoes stdin back to stdout, but implemented using copatterns | |
-- instead of musical notation, as requested by Miëtek Bak (https://twitter.com/mietek/status/806314271747481600). | |
open import Data.Nat | |
open import Data.Unit | |
open import Data.Bool | |
open import Data.Char |
This file contains hidden or 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
char *normalize(char *src) { | |
char *r = (char *)(malloc(strlen(src)+2)); | |
char *dst = r; | |
if (*src != '/') { | |
*dst++ = '/'; | |
} | |
char *bt = dst; | |
char *bt2 = dst; | |
int dot = 0; | |
while (*src) { |
This file contains hidden or 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
module Topology where | |
import Level | |
open import Function | |
open import Data.Empty | |
open import Data.Unit | |
open import Data.Nat hiding (_⊔_) | |
open import Data.Fin | |
open import Data.Product | |
open import Relation.Nullary |
This file contains hidden or 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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module Language.HigherRank.Main | |
( Expr(..) | |
, EVar(..) | |
, Type(..) | |
, TVar(..) | |
, TEVar(..) | |
, runInfer | |
) where |