- Go to definition:
cmd + B
- Go to list of all method declarations:
cmd + opt + B
- Line up and down:
cmd + shift + up or down arrow
- Expansive text selection:
option + up arrow (as many times as needed)
cmd+[
: go backcmd+]
: go forwardalt+F7
: find usages of the identifier under the cursor.
module Main where | |
import Prelude | |
import Control.Comonad (class Comonad, class Extend, extend, extract) | |
import Control.Monad.Eff.Console (log) | |
import Data.Array ((..), (!!), cons, length, replicate, zipWith) | |
import Data.Function (on) | |
import Data.Int (fromStringAs, binary, toNumber, floor) | |
import Data.Int.Bits ((.&.)) |
First, install the required software:
- Open CMD (windows > run > type "cmd" > enter).
- Run
geth.exe --dev --ipcpath geth.ipc console
/** | |
This code snippet aims to show how to prevent library methods from being executed directly. | |
That's achieved by baking in the address of the library before it's deployed, then comparing `address(this)` against the saved address within a modifier. | |
A contract/library address is deterministic, so one could inject that in: keccak256(creator_address, nonceValue). | |
Thanks to @pirapira, @chriseth and @arachnid for the idea. | |
*/ |
A "Cuckoo Filter" is a nifty data structure invented a few years ago; read the paper for details.
Like a Bloom filter, you insert items and then can later ask "does this item exist in the filter?" You'll get either a definite "no" or "yes, probably" with some false-positive error rate. Cuckoo filters have two advantages over Bloom filters:
- They are more space efficient at false positive rates less than about 0.03.
- You can delete items from them without affecting the false positive rate at all.
It seems to me that an in-memory cuckoo filter could work really well to keep track of Bitcoin's "unspent transaction output set" (UTXO set), to make transaction (or block) validation as fast as possible using minimal memory or disk.
Recall that Bitcoin transactions (other than coinbase transactions that create new coins) have inputs that refer to unspent outputs. An input refers to a previous output by giving the transaction id (a 32-byte hash) co