Skip to content

Instantly share code, notes, and snippets.

View aupiff's full-sized avatar

Roy Blankman aupiff

View GitHub Profile
# Plotting a differential field and a curve satisfying it
set term png enhanced size 3600,2800
set output 'homogeneous.png'
set xrange [-1:1]
set yrange [0:0.8]
set samples 500
set isosamples 200

Keybase proof

I hereby claim:

  • I am aupiff on github.
  • I am aupiff (https://keybase.io/aupiff) on keybase.
  • I have a public key ASCqTVE4l4WHL8CZO00CqTWMF2dHP9fcBAuDgCC2D_uarQo

To claim this, I am signing this object:

#!/bin/sh
# project euler 66
max=0
max_index=0
for i in $(seq 2 1000)
do
a=$(echo "sqrt ($i)" | bc)
#!/bin/sh
# p64: How many continued fractions for N≤10000 have an odd period?
odd=0
for i in $(seq 2 10000)
do
a=$(echo "sqrt ($i)" | bc)
s=$a
@aupiff
aupiff / bench.md
Last active May 19, 2019 16:38
eultoil

on macbook pro:

Using the non-posix compliant array functionality results in fast code.

$ time bash p43.sh
16695334890

real    0m11.997s
user    0m15.626s
sys     0m11.549s
@aupiff
aupiff / tls.sh
Created February 10, 2018 00:27 — forked from canterberry/tls.sh
CLI for generating TLS key, certificate signing request (CSR), and self-signed certificate
#!/usr/bin/env bash
# ============================================================================ #
# This CLI tool is a working reference implementation for generating TLS
# private keys, certificate signing requests (CSRs), and self-signed
# certificates. The benefits of using this tool vs OpenSSL directly are as
# follows:
#
# * Significantly easier to use than OpenSSL.
#
# * Strong keys by default (ECC with secp384r1 curve).

When I wanted to create the data volume that contained all the blockchain data.

docker run -it -p 30303:30303 -v /path/on/host:/root/.ethereum ethereum/client-go

This created a bind mount which is not ideal,

        "Mounts": [
            {
                "Type": "bind",
 "Source": "/Users/aupiff/ethereum",
[{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ucacs","outputs":[{"name":"ucacContractAddr","type":"address"},{"name":"totalStakedTokens","type":"uint256"},{"name":"txLevel","type":"uint256"},{"name":"lastTxTimestamp","type":"uint256"},{"name":"denomination","type":"bytes32"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"txPerGigaTokenPerHour","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_tokensToOwnUcac","type":"uint256"}],"name":"setTokensToOwnUcac","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_ucacContractAddr","type":"address"},{"name":"_ucacId","type":"bytes32"},{"name":"_denomination","type":"bytes32"},{"name":"_tokensToStake","type":"uint256"}],"name":"createAndStakeUcac","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_txPerGigaTokenPerHour","type":"uint256"}],"name":"setTxPerGigaTokenPerHour","outputs":[],"payabl

Cleanup conducted at Sun Jan 28 14:56:39 EST 2018.

Our goal is to reconcile any discrepencies between the verified_credits table and the ethereum blockchain.

First, we'll check what entries exist in the verified_credits table that do no exist on the blockchain.

$ curl localhost/unsubmitted
[ {"ucac":"0x869a8f2c3d22be392618ed06c8f548d1d5b5aed6","creditor":"0x3a1ea286e419130d894c9fa0cf49898bc81f9a5a","debtor":"0x754952bfa2097104a07f4f347e513a1da576ac7a","amount":265,"nonce":2,"memo":"Starbucks                       "}
, {"ucac":"0x869a8f2c3d22be392618ed06c8f548d1d5b5aed6","creditor":"0x754952bfa2097104a07f4f347e513a1da576ac7a","debtor":"0x3a1ea286e419130d894c9fa0cf49898bc81f9a5a","amount":326,"nonce":2,"memo":"Uber                            "}
[
{
"memo": "Starbucks ",
"nonce": 2,
"amount": 265,
"debtor": "0x754952bfa2097104a07f4f347e513a1da576ac7a",
"creditor": "0x3a1ea286e419130d894c9fa0cf49898bc81f9a5a",
"ucac": "0x869a8f2c3d22be392618ed06c8f548d1d5b5aed6"
},
{