Skip to content

Instantly share code, notes, and snippets.

View spolu's full-sized avatar

Stanislas Polu spolu

View GitHub Profile
@spolu
spolu / protocol_a.md
Last active August 29, 2015 14:10
Candidate Set Protocol - A

Notations:

  • Transaction t: a value submitted by a client of the FBA network that can be independently validated by each node.
  • Transaction Set s^v: a set of transactions submitted by clients to a particular node v.
  • Node block b^v: of the form <s^v, H(B)> a transaction set and a reference to a master block
  • Master block B: of the form <s^0, s^1, s^3, ..., s^n> a set of node blocks (at most one per node)
  • Hash funciton H(.): hash function that may include signature as security requires

Definitions:

@spolu
spolu / block.c
Last active August 29, 2015 14:10
FBA Blockchains
struct block {
char* hash; // the hash of the block Signature(priv_key, H(pub_key, parent, siblings))
char* pub_key; // the node public key with which the block chain is associated
block** parents; // the list of head blocks in the local and foreign blockchains
}
Verifying that +spolu is my openname (Bitcoin username). https://onename.io/spolu
@spolu
spolu / _README.md
Last active August 29, 2015 14:09 — forked from morganrallen/_README.md

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$&gt; npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@spolu
spolu / shallow_inversion.txt
Last active August 29, 2015 14:09
Shallow Inversion Results
// FORMAT: h' [size] likes_last_1000 N(h')[h]
// h = #travel
earthpix [96275] 426896 135
bestvacations [401879] 393787 220
galapagos [93087] 356080 148
places_wow [38407] 353363 103
exploringtheglobe [106674] 331692 145
nationalpark [432121] 314278 146
luxurytravel [71577] 304897 555
@spolu
spolu / cosinus_similarity_vs_most_common.txt
Created November 12, 2014 18:28
Cosinus Similarity vs Top Common
// TOP COSINUS (TOP_256(H)) // TOP COMMON
// hashtag [common] cosinus // hashtag [common]
lavazza [29] 0.9872244864381207 coffee [508]
ilovecoffee [10] 0.9847560750411948 espresso [272]
koffie [2] 0.9846375245504507 moka [191]
kaffe [6] 0.98294402730886 italy [85]
lovecoffee [5] 0.9821784890380654 goodmorning [59]
frenchpress [7] 0.9811594380962438 caffeine [55]
bestcoffee [2] 0.9810636114092183 mokapot [54]
@spolu
spolu / simil_cos.js
Created November 12, 2014 18:09
Similarity / Cosinus computation
var simil = related_top.map(function(rel_top) {
var product = rel_top.map(function(v, i) {
return v * hashtag_top[i];
}).reduce(function(prev, curr) {
return prev + curr;
});
var norm_x = Math.sqrt(rel_top.map(function(v, i) {
return v * v;
}).reduce(function(prev, curr) {
@spolu
spolu / top42-tags.txt
Last active August 29, 2015 14:09
42 top Instagram Tags
love 686078880 igers 143551921
instagood 310350595 instalike 134426393
me 293679698 food 132202433
tbt 268619321 swag 130019651
cute 254912838 amazing 126691409
follow 254733448 tflers 126313497
followme 236747722 follow4follow 116094944
photooftheday 235406793 bestoftheday 115814355
happy 218811654 instamood 109366323
tagsforlikes 218281947 style 103138246
@spolu
spolu / distribution.txt
Created November 12, 2014 00:22
Tag / # posts
# posts : count(tag)
0 : 1639
0-10 : 1171045
10-100 : 1287954
100-1k : 1649221
1k-10k : 937380
10k-100k : 214278
100k-1m : 36474
1m-10m : 5115
@spolu
spolu / af9873975ce53184e40e8d7865b484ab346b854c
Last active August 29, 2015 14:09
DATA/a/f/af9873975ce53184e40e8d7865b484ab346b854c
yosemitenationalpark // `h`
43265 1023 127224 4133 // `size` `retrieved` `likes` `comments`
yosemite 585 // `h'` `N(h)[h']`
california 315 // ...
nature 247
halfdome 145
yosemitevalley 109
roadtrip 105
hiking 105
nationalpark 94