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
| event stdout(data) | |
| # prints an array to stdout | |
| # $a: array | |
| # $n: array length | |
| macro log_array($a, $n): | |
| with $i = 0: | |
| while $i < $n: | |
| log(type=stdout, $a[$i]) | |
| $i += 1 |
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
| # loads an array from contract data | |
| # $a: array | |
| # $n: array length | |
| macro fetch($a, $n): | |
| with $memarray = array($n): | |
| with $i = 0: | |
| while $i < $n: | |
| $memarray[$i] = $a[$i] | |
| $i += 1 | |
| $memarray |
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
| data stuff[] | |
| def load_stuff_success(): | |
| mystuff = array(2) | |
| mystuff[0] = 4 | |
| mystuff[1] = 5 | |
| save(self.stuff[0], mystuff, items=2) | |
| stuff = load(self.stuff[0], items=2) |
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
| function hex_to_utf16le(hex) { | |
| var output = ''; | |
| for (var i = 0, l = hex.length; i < l; i += 4) { | |
| output += '\\u' + hex.slice(i+2, i+4) + hex.slice(i, i+2); | |
| } | |
| return JSON.parse('"' + output + '"'); | |
| } |
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
| #!/usr/bin/env node | |
| var assert = require("assert"); | |
| // note: btc.total and btc.balance in BTC, not satoshis! | |
| function calculateRepPercentage(btc, eth, exchangeRate) { | |
| return (eth.balance*exchangeRate + btc.balance) / (eth.total*exchangeRate + btc.total); | |
| } | |
| var test = function (t) { |
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
| compiling /home/jack/src/augur-core/src/consensus/center.se | |
| compiling /home/jack/src/augur-core/src/consensus/resolve.se | |
| compiling /home/jack/src/augur-core/src/consensus/payout.se | |
| compiling /home/jack/src/augur-core/src/consensus/redeem_interpolate.se | |
| compiling /home/jack/src/augur-core/src/consensus/redeem_payout.se | |
| compiling /home/jack/src/augur-core/src/consensus/redeem_score.se | |
| compiling /home/jack/src/augur-core/src/consensus/redeem_adjust.se | |
| compiling /home/jack/src/augur-core/src/consensus/score.se | |
| compiling /home/jack/src/augur-core/src/consensus/redeem_resolve.se | |
| compiling /home/jack/src/augur-core/src/consensus/statistics.se |
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
| #!/usr/bin/env python | |
| from __future__ import division | |
| import os | |
| import json | |
| import csv | |
| import datetime as dt | |
| BTC_PRICE = 229.27 | |
| DATA_DIR = "data" |
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
| { | |
| "_id": "-0x27c260497c598ffcf8d32a78284506cf64ba717cc8893a4a909605a19f6a6976", | |
| "branchId": "0xf69b5", | |
| "events": [{ | |
| "id": "-0xd7c83c1f39f9a43eae32d12538117ca5f6234e937c10e7b5f88db1adada2f3b5", | |
| "description": "Will Federal Reserve Hike Rates in September 2015?", | |
| "outcome": "0" | |
| }], | |
| "price": "0.7691190609260657807", | |
| "tradingFee": "0.01999999999999999998", |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from __future__ import division | |
| import numpy as np | |
| np.set_printoptions(linewidth=120, | |
| suppress=True, | |
| formatter={"float": "{: 0.6f}".format}) |
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
| /** | |
| * geth ipc connection | |
| * @author Jack Peterson ([email protected]) | |
| */ | |
| #include <stdio.h> | |
| #include <sys/socket.h> | |
| #include <sys/un.h> | |
| #include <unistd.h> | |
| #include <string.h> |