https://en.wikipedia.org/wiki/Median_mechanism
Keep a min heap and a max heap in two solidity arrays.
If a new vote is greater than root of the min heap, insert it there, otherwise insert it in the max heap.
https://en.wikipedia.org/wiki/Median_mechanism
Keep a min heap and a max heap in two solidity arrays.
If a new vote is greater than root of the min heap, insert it there, otherwise insert it in the max heap.
| const CryptoJS = require("crypto-js"); | |
| const nacl = require("tweetnacl"); | |
| const B64 = require("base64-js"); | |
| const { create } = require("apisauce"); | |
| const assert = require("assert"); | |
| const qrcode = require("qrcode-terminal"); | |
| const baseURL = "http://test.brightid.org/profile"; | |
| const api = create({ | |
| baseURL, |
| <?xml version='1.0' encoding='UTF-8'?> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <include>myImage</include> | |
| </head> | |
| <body> | |
| <myImage> | |
| <base>..</base> | |
| </myImage> | |
| </body> |
| // adapted from: http://blog.zachwaugh.com/post/309927273/programmatically-retrieving-ip-address-of-iphone | |
| - (NSString *)getIPAddress { | |
| Boolean result; | |
| CFHostRef hostRef; | |
| CFArrayRef addresses; | |
| NSString *hostname = @"domain.myhost.com"; | |
| NSString *ipAddress = @""; | |
| hostRef = CFHostCreateWithName(kCFAllocatorDefault, (CFStringRef)hostname); | |
| if (hostRef) { |
| 1) Create a branch with the tag | |
| git branch {tagname}-branch {tagname} | |
| git checkout {tagname}-branch | |
| 2) Include the fix manually if it's just a change .... | |
| git add . | |
| git ci -m "Fix included" | |
| or cherry-pick the commit, whatever is easier | |
| git cherry-pick {num_commit} | |