Title: Bitcoin Address Discovery Protocol over SMS
Author: Bouke Versteegh <[email protected]>
Status: Draft
Created: 2014-03-14
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
sites: | |
apidoc: | |
scheme: http | |
host: apidoctest.elephone.vb | |
api: | |
scheme: http | |
host: api.elephone.vb | |
nginx_sites: | |
<<<<<<< HEAD |
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 math | |
import sys | |
''' | |
python haar.py | |
python haar.py 1 5 3 1 | |
''' | |
def wrap(value, ubound): |
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
/* TRIANGLE */ | |
.triangle { | |
width: 0; | |
height: 0; | |
border-width: 10px; | |
border-style: solid; | |
border-color: transparent; | |
font-size: 0; | |
} |
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
<?php | |
abstract class DefaultController { | |
public function read($id) { | |
if( empty($id) ) { | |
throw Exception("No ID specified!"); | |
} | |
$this->_read($id); | |
} | |
public abstract function _read($id); |
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
javascript:document.location = $('[href^="//' + ['nl', 'en'][0+(document.location.host.substr(0,2)=="nl")] + '.wikipedia.org"]').attr('href'); |
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 inspect | |
# Callable class to wrap functions | |
class F: | |
def __init__(self, func, *args): | |
self.func = func | |
self.args = args | |
# Currying |
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
class Gate { | |
protected: | |
Out outputs[]; | |
public: | |
virtual void propagate(); | |
}; | |
void Gate::propagate() { | |
int noutputs = sizeof(this->outputs)/sizeof(*(this->outputs)); | |
cout << noutputs << " outputs."; |
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 multiprocessing | |
# Define a function | |
square = lambda x: x**2 | |
if __name__ == "__main__": | |
mylist = [1, 2, 3, 4, 9, 2, 5, 2, 7, 0, 5, 4, 1, 3, 5, 7] | |
# Create a pool with 8 multicore threads | |
# Apply the function to all arguments in the list |
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
# Given a position (x,y), returns next position in a grid spiral. | |
def next(pos): | |
x, y = pos | |
top = False | |
right = False | |
bottom = False | |
left = False | |
horizontal = abs(x) <= abs(y) | |
vertical = abs(y) <= abs(x) |