Skip to content

Instantly share code, notes, and snippets.

@PirosB3
PirosB3 / documentation.md
Last active August 7, 2020 23:23
0xDoc Documentation

0x Doc

Links

0x Doc was created to serve technically-savvy users such as market-makers, 0x API integrators, and RFQ providers that want to gain more insight from the on-chain magic that happens in 0x.

How does it work?

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PirosB3
PirosB3 / gist:81047a463d687034e5d1
Created December 4, 2014 17:11
SMO SVM Python implementation
def smoSimple(dataIn, classLabels, C, tolerance, maxIter):
dataMatrix = mat(dataIn)
labelMat = mat(classLabels).T
m, n = shape(dataMatrix)
alphas = mat(zeros((m,1)))
bias = 0
iter = 0
while (iter < maxIter):
@PirosB3
PirosB3 / commitment.sol
Created May 18, 2018 05:43
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Commitment {
enum CommitmentState { OPEN, CLOSED }
mapping (address => bool) attendeesRegistered;
mapping (address => bool) attendeesRefunded;
uint totalDeposited;
uint totalGuests;
@PirosB3
PirosB3 / commitment.sol
Created May 18, 2018 05:28
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Commitment {
enum CommitmentState { OPEN, CLOSED }
mapping (address => bool) attendeesRegistered;
mapping (address => bool) attendeesRefunded;
uint totalDeposited;
uint totalGuests;
@PirosB3
PirosB3 / ballot.sol
Created May 18, 2018 05:15
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
from typing import Tuple, NamedTuple, List, Optional, Dict
class SpendResult(NamedTuple):
is_successful: bool
remaining_balance: int
class Bank(object):
@PirosB3
PirosB3 / main.py
Created January 13, 2016 08:17
Quora.challenge
import itertools
import sys
def non_increasing_range(items, i, j, _c):
try:
d = _c[(i, j)]
return d
except KeyError:
pass
@PirosB3
PirosB3 / gist:7153953
Created October 25, 2013 12:31
Rendering code
//**************************************************************************//
// This is a modified version of the Microsoft sample code and loads a mesh.//
// it uses the helper class CDXUTSDKMesh, as there is no longer any built in//
// support for meshes in DirectX 11. //
// //
// The CDXUTSDKMesh is NOT DorectX, not is the file format it uses, the //
// .sdkmesh, a standard file format. You will hnot find the .sdkmesh format //
// outside the MS sample code. Both these things are provided as an entry //
// point only. //
// //
{
"txid": "8608b1ee194cdacbd3b2d1728b4883afe11a76d4a60b3d8d1f36317ccc12d583",
"hash": "8608b1ee194cdacbd3b2d1728b4883afe11a76d4a60b3d8d1f36317ccc12d583",
"size": 224,
"vsize": 224,
"version": 2,
"locktime": 1488155936,
"vin": [
{
"txid": "a7681326607bbb94026fca9f21563b2c1418c22b8e39638f7910e338915ead46",