100.00000000 100.63040201 100.67820004 100.75418227 100.80404273 100.88497099 100.97406618 103.08327523 103.23681735 [104.31415152](https://blockchain.info/tx/4e15ce4722
This file contains 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
// g++ UniversalTimer.o BinaryData.o FileDataPtr.o BtcUtils.o BlockObj.o BlockUtils.o libcryptopp.a -o bootstrap.out -Icryptopp -DUSE_CRYPTOPP -D__STDC_LIMIT_MACROS -lpthread bootstrap.cpp | |
#include "BlockUtils.h" | |
int main(void) | |
{ | |
string btcdir("/home/chris/.bitcoin"); | |
string bootstrap(btcdir + "/" + "bootstrap.dat"); | |
BlockDataManager_FileRefs::GetInstance().SelectNetwork("Main"); | |
BlockDataManager_FileRefs & bdm = BlockDataManager_FileRefs::GetInstance(); |
This file contains 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 | |
import hmac | |
import hashlib | |
from sys import argv, exit, stderr | |
def hmac_sha512(key, message): | |
return hmac.new(key, message, hashlib.sha512).hexdigest() | |
def roll(server_seed, client_seed, nonce): | |
# Generate key and message strings. |
This file contains 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
#include <boost/spirit/include/classic_core.hpp> | |
#include <iostream> | |
#include <string> | |
#include <stdio.h> | |
#include <stdint.h> | |
using namespace std; | |
using namespace boost::spirit::classic; | |
struct count_satoshis |
This file contains 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
{ | |
"nonce": "0x0000000000000042", | |
"difficulty": "0x40000", | |
"alloc": { | |
"bbbbbaaaaa82db86a35502193b4c6ee9a76ebe8f": { | |
"balance": "10015200000000000000000" | |
}, | |
}, | |
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", | |
"coinbase": "0x0000000000000000000000000000000000000000", |
This file contains 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/python | |
from __future__ import print_function | |
import base64, httplib, json, string, sys, re | |
USER = 'user'; PASS = 'pass'; HOST = '127.0.0.1'; PORT = 30174 | |
class RPC: | |
def __init__(self, host, port, username, password): | |
self.authhdr = "Basic %s" % (base64.b64encode("%s:%s" % (username, password))) | |
self.conn = httplib.HTTPConnection(host, port, False, 30) |
This file contains 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
import random, math | |
num_sims = 1000 | |
num_rolls = 1000 | |
chance = 5/100.0 | |
edge = 1 - 2*chance | |
start_bank = 1000 | |
risk = 0 | |
while risk < 1: |
This file contains 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
Verifying that +dooglus2 is my blockchain ID. https://onename.com/dooglus2 |
This file contains 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 | |
class Point(object): | |
def __init__(self, _x, _y, _order = None): self.x, self.y, self.order = _x, _y, _order | |
def calc(self, top, bottom, other_x): | |
l = (top * inverse_mod(bottom)) % p | |
x3 = (l * l - self.x - other_x) % p | |
return Point(x3, (l * (self.x - x3) - self.y) % p) |
This file contains 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
def evaluate(hand): | |
ranks = '23456789TJQKA' | |
if len(hand) > 5: return max([evaluate(hand[:i] + hand[i+1:]) for i in range(len(hand))]) | |
score, ranks = zip(*sorted((cnt, rank) for rank, cnt in {ranks.find(r): ''.join(hand).count(r) for r, _ in hand}.items())[::-1]) | |
if len(score) == 5: # if there are 5 different ranks it could be a straight or a flush (or both) | |
if ranks[0:2] == (12, 3): ranks = (3, 2, 1, 0, -1) # adjust if 5 high straight | |
score = ([1,(3,1,2)],[(3,1,3),(5,)])[len({suit for _, suit in hand}) == 1][ranks[0] - ranks[4] == 4] # high card, straight, flush, straight flush | |
return score, ranks |
OlderNewer