Skip to content

Instantly share code, notes, and snippets.

View donovanhide's full-sized avatar

Donovan Hide donovanhide

View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am donovanhide on github.
* I am donovanhide (https://keybase.io/donovanhide) on keybase.
* I have a public key ASAj9Cqsyj3J456MPDjlczcODZEfoPRmIphT5XiWRuzA7Ao
To claim this, I am signing this object:
package main
type XDR Peg {
}
CompilationUnit <- Specification EOT
Declaration <- (TypeSpecifier Identifier) / (TypeSpecifier Identifier LBRK Value RBRK) / (TypeSpecifier Identifier LT Value? GT) / (OPAQUE Identifier LBRK Value RBRK) / (OPAQUE Identifier LT Value? GT) / (STRING Identifier LT Value? GT) / (TypeSpecifier STAR Identifier) / VOID
Value <- Constant / Identifier
@donovanhide
donovanhide / gist:fa79455714eba7980a20
Created August 15, 2015 16:50
Small trade rates example
q)select from t where rate>200
base_amount counter_amount rate buyer executed_time ledger_index offer_sequence provider seller taker tx_hash tx_type
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.57196e-09 1e-06 279.9583 rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV 2015.08.12T00:46:20.000 15202228 185 rMjVcgSgfXucfkRs18a4BGStZ1zS5ki1jC rMjVcgSgfXucfkRs18a4BGStZ1zS5ki1jC rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV "30E79E82BA05C8559F0C17C9DA39FE9092E070470C5B3FB1C986311F29883B41" OfferCreate
3.4926e-09 1e-06 286.3196 rBxy23n7ZFbUpS699rFVj1V9ZVhAq6EGwC 2015.
@donovanhide
donovanhide / gist:427dba87380c0d892ff2
Created September 30, 2014 22:17
Get XRP balances
./rippled ledger current full| jq -r '.result.ledger.accountState[]|select(.LedgerEntryType=="AccountRoot")|"\(.Account),\(.Balance|tonumber|./1000000)/XRP"'| sort -n -k2 -t, -r
@donovanhide
donovanhide / gist:eb11acc4cf362768ddac
Last active August 29, 2015 14:06
Buffer balancing vs Random Balancing
Buffer Balancing algorithm after 10 rounds of inserting 100,000 keys
Entries per node is stable
Level: 0 Nodes: 1 Entries: 8 WellFormed: 1 Occupied: 100.00% Share: 0.00%
Level: 1 Nodes: 9 Entries: 72 WellFormed: 9 Occupied: 100.00% Share: 0.03%
Level: 2 Nodes: 81 Entries: 648 WellFormed: 81 Occupied: 100.00% Share: 0.30%
Level: 3 Nodes: 689 Entries: 4930 WellFormed: 689 Occupied: 94.51% Share: 2.52%
Level: 4 Nodes: 3994 Entries: 22628 WellFormed: 3994 Occupied: 60.87% Share: 14.63%
Level: 5 Nodes: 10887 Entries: 41946 WellFormed: 10887 Occupied: 18.44% Share: 39.88%
Level: 6 Nodes: 9377 Entries: 25262 WellFormed: 9377 Occupied: 1.76% Share: 34.35%
@donovanhide
donovanhide / gist:d0788bcd021ff7adc609
Created September 7, 2014 22:34
Keyvadb tree distribution using random balancer
Level: 0 Nodes: 1 Entries: 8 WellFormed: 1 Occupied: 100.00% Share: 0.00%
Level: 1 Nodes: 9 Entries: 72 WellFormed: 9 Occupied: 100.00% Share: 0.00%
Level: 2 Nodes: 81 Entries: 648 WellFormed: 81 Occupied: 100.00% Share: 0.02%
Level: 3 Nodes: 727 Entries: 5316 WellFormed: 727 Occupied: 99.73% Share: 0.16%
Level: 4 Nodes: 5591 Entries: 31867 WellFormed: 5591 Occupied: 85.22% Share: 1.21%
Level: 5 Nodes: 29194 Entries: 113262 WellFormed: 29194 Occupied: 49.44% Share: 6.32%
Level: 6 Nodes: 82299 Entries: 225420 WellFormed: 82299 Occupied: 15.49% Share: 17.81%
Level: 7 Nodes: 125925 Entries: 267137 WellFormed: 125925 Occupied: 2.63% Share: 27.25%
Level: 8 Nodes: 115377 Entries: 202581 WellFormed: 115377 Occupied: 0.27% Share: 24.97%
Level: 9 Nodes: 67456 Entries: 104461 WellFormed: 67456 Occupied: 0.02% Share: 14.60%
@donovanhide
donovanhide / gist:a15dfbf5ec93ad59f593
Last active August 29, 2015 14:05
Top 1000 highest fee-paying transactions
+------------------------------------+----------------+------------------+------------------------------------------------------------------+-------------+
| Human | LedgerSequence | TransactionIndex | hex(Hash) | amount(Fee) |
+------------------------------------+----------------+------------------+------------------------------------------------------------------+-------------+
| rEX9CRmeJMhGi95xcZ7bgkQmEDsx67QBfK | 7081011 | 0 | D80E3BBF25685521093B8CF51EF53ACCE27AEE07969B2BE5A6852A07F7DBD850 | 115.5 |
| rBXuPiEUXbRwWqLv4wkMLDKpQWVDviZBzm | 2170151 | 4 | 47474965D039F2D077FA254552EC46123965907E79B13F5B967BE6E85DCAA90E | 104.600733 |
| rNdxQtsRYxttm8ShpPUxk8shq15joW3ozc | 3691738 | 15 | 8612902B19CF7A75A072B285F3C02F2DDE283827FAA452F273BC36871F1E18CD | 99.995548 |
| rbvFfuUysurzPHq5kgs53A16j5svbFxgv | 2169731 | 0 | 0FA9B61C5EED2
@donovanhide
donovanhide / gist:9996f486f530ca862bc3
Last active August 29, 2015 14:05
Strange Bitstamp transactions...
+----------------+------------------+------------------------------------------------------------------+------------------------------------+--------------------------------------------------------------------------------------------------+
| LedgerSequence | TransactionIndex | Hex(Hash) | Human | amount(p.Amount) |
+----------------+------------------+------------------------------------------------------------------+------------------------------------+--------------------------------------------------------------------------------------------------+
| 330418 | 0 | 9DE4E8455674CE954AA8483C87DE49F666F27D9C0FD42ACB32EA011E8017A645 | rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E | 0.1 |
| 330455 | 0 | 630EECDF122A9B42964334
@donovanhide
donovanhide / gist:ae86f05b842bb0fbf85e
Created August 14, 2014 16:39
Ripple transactions by week and year
SELECT * FROM(
-> SELECT WEEK(FROM_UNIXTIME(CloseTime+946684800)) AS Week,
-> YEAR(FROM_UNIXTIME(CloseTime+946684800)) AS Year,
-> COUNT(*) AS Total,
-> SUM(IF(TransactionType=0,1,0)) AS Payment,
-> SUM(IF(TransactionType=3,1,0)) AS AccountSet,
-> SUM(IF(TransactionType=5,1,0)) AS SetRegularKey,
-> SUM(IF(TransactionType=7,1,0)) AS OfferCreate,
-> SUM(IF(TransactionType=8,1,0)) AS OfferCancel,
-> SUM(IF(TransactionType=20,1,0)) AS TrustSet,