I hereby claim:
- I am ldub on github.
- I am dubinets (https://keybase.io/dubinets) on keybase.
- I have a public key ASCFyLfBTpZFU_Iihxb402Mnse-EZHIF63q9ECfh_SJNMAo
To claim this, I am signing this object:
Given an array of N points in a plane, find the circle which contains the maximum numbers of the given points on its perimiter. | |
for each pair of points { // O(N^2) | |
for each of the N-2 remaining points { // O(N) | |
compute radius and center of circle defined by the 3 chosen points | |
} | |
sort list by radius // O(N*log(N)) | |
filter list by (most common radius) and (most common center) // O(N) ? is it O(N)? | |
return (radius, center x, center y, number of matching circles); | |
} |
This is an excersize in point-free Haskell. | |
To create a function that adds two numbers we could write: | |
λ> let f a b = a + b | |
Or alternatively | |
λ> let f = (+) | |
Now, how about a function that adds three numbers? | |
λ> let g = (+) . (+) --Doesn't work |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
public class Shuffle { | |
public static void main(String[] args) { | |
String str = "shuf_ftw"; | |
try { | |
String shuffled = (new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(new String[] { "sh", "-c", "echo " + str + " | fold -w1 | shuf | tr -d '\n'" }).getInputStream()))).readLine(); | |
System.out.println(shuffled); |
// Transpose does this | |
// {1, 2, 3, 4} {1, 5, 9} | |
// {5, 6, 7, 8} ==> {2, 6, 10} | |
// {9,10,11,12} {3, 7, 11} | |
// {4, 8, 12} | |
void Main() | |
{ | |
List<List<int>> list = new List<List<int>>() { | |
new List<int>() {1, 2, 3, 4}, | |
new List<int>() {5, 6, 7, 8}, |
I hereby claim:
To claim this, I am signing this object:
first two transactions from 0x6B477781b0e68031109f21887e6B5afEAaEB002b
:
0xd79fc80e7b787802602f3317b7fe67765c14a7d40c3e0dcb266e63657f8813961
0x061bf0b4b5fdb64ac475795e9bc5a3978f985919ce6747ce2cfbbcaccaf51009
lets ask infura for more information...
λ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x061bf0b4b5fdb64ac475795e9bc5a3978f985919ce6747ce2cfbbcaccaf51009"],"id":1}' https://ropsten.infura.io/v3/
{
"jsonrpc": "2.0",
-- counts the number of shielded zcash transactions sent between 2019-01-01 to 2019-05-29 | |
SELECT COUNT(*) AS num_shielded_txs FROM `bigquery-public-data.crypto_zcash.transactions` AS zec_txs | |
WHERE | |
zec_txs.is_coinbase = FALSE | |
AND zec_txs.block_timestamp >= '2019-01-01' | |
AND zec_txs.block_timestamp <= '2019-05-29' | |
AND (zec_txs.input_count = 0 | |
OR zec_txs.output_count = 0 | |
OR EXISTS (SELECT 1 FROM UNNEST(zec_txs.inputs) WHERE type = 'shielded') | |
OR EXISTS (SELECT 1 FROM UNNEST(zec_txs.outputs) WHERE type = 'shielded')) |
See https://medium.com/@levdubinets/zcash-shielded-transaction-censorship-12098f21090b for details | |
+-------------------------+------------------------------------------------------------------+------------------------------------------------------------------+-------------+--------------+-----------------+------------------+ | |
| block_timestamp | hash | block_hash | input_count | output_count | shielded_inputs | shielded_outputs | | |
+-------------------------+------------------------------------------------------------------+------------------------------------------------------------------+-------------+--------------+-----------------+------------------+ | |
| 2019-05-25 02:02:31 UTC | 8c012d877b041a3ff4c828793add1032eebd12ee132d38c33997ade2b1d174da | 0000000000138bf56bac6964501f177b1836bea6f7b8445452d0a8b3bafa631a | 1 | 1 | 1 | 0 | | |
+----------- |
ap-northeast-1;ap-northeast-1a;"a1.2xlarge" | |
ap-northeast-1;ap-northeast-1a;"a1.4xlarge" | |
ap-northeast-1;ap-northeast-1a;"a1.large" | |
ap-northeast-1;ap-northeast-1a;"a1.medium" | |
ap-northeast-1;ap-northeast-1a;"a1.metal" | |
ap-northeast-1;ap-northeast-1a;"a1.xlarge" | |
ap-northeast-1;ap-northeast-1a;"c1.medium" | |
ap-northeast-1;ap-northeast-1a;"c1.xlarge" | |
ap-northeast-1;ap-northeast-1a;"c3.2xlarge" | |
ap-northeast-1;ap-northeast-1a;"c3.4xlarge" |
// assumes words are all on one line split by spaces | |
//const words = require("fs").readFileSync("bip39.txt", "utf8").split(" ").sort(); | |
const words = "animal adjective animation build bridge".split(" ").sort() | |
let trie = {}; | |
for (let i = 0; i < words.length; i++ ) { | |
const word = words[i]; | |
const letters = word.split(""); | |
let pointer = trie; // save pointer for traversal |