This file contains hidden or 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
# election two categories of voters: | |
# 20 voters with weight 1, 2 voters with weight 10 | |
# 10x + y = 20 | |
# x <= 2, y <= 20 | |
# three solution points: (2, 0), (1, 10), (0, 20) | |
# particular solution (origin): | |
# [0 20] | |
# basis | |
# [1 -10] |
This file contains hidden or 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
5 5 | |
94 -17 -8 -4 -2 | |
# 96 -17 -10 -4 -2 | |
2 -1 0 0 0 | |
6 0 -1 0 0 | |
6 0 0 -1 0 | |
10 0 0 0 -1 | |
# m(v, c, r) | |
# linearity 2 1 2 | |
# Ar |
This file contains hidden or 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 scala.collection.SortedSet | |
trait Method { | |
// options to choose from | |
type Option | |
// a choice made on the ballot | |
type Choice | |
// a completed ballot | |
type Ballot | |
// the voting rule (algorithm) |
This file contains hidden or 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
/* | |
* | |
* Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or | |
* without modification, are permitted provided that the following | |
* conditions are met: | |
* | |
* -Redistribution of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. |
This file contains hidden or 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
play.ws.ssl { | |
trustManager = { | |
stores = [ | |
{ type = "PEM", path = "server.crt" } | |
] | |
} | |
keyManager = { | |
stores = [ | |
{ type="PKCS12", path="client.p12", password="client" } | |
] |
This file contains hidden or 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 java.io.File | |
import akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import play.api.libs.ws.WSClient | |
import play.api.libs.ws.WSConfigParser | |
import scala.concurrent.Future | |
import scala.util.{Success, Failure} | |
import play.api.{Environment, Mode} | |
import play.api.Configuration |
This file contains hidden or 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
object E extends App { | |
println(E(args(0).toInt, 1)) | |
def E(vars: Int, minVar: Int) : String = { | |
if(vars == 1) { | |
"T" | |
} | |
else if(vars == 2) { | |
s"!(a$minVar && a${minVar + 1})" | |
} |
This file contains hidden or 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
machine bb_orchestrator_machine sees bb_orchestrator_context | |
variables config config_signatures shares shares_signatures public_key public_key_signatures | |
vote_started votes mixes mixes_signatures decryptions decryptions_signatures | |
plaintext plaintext_signatures process_end | |
invariants | |
@inv0 config ∈ BOOL @inv1 config_signatures ∈ ℙ(1 ‥ privacy_level) | |
@inv2 shares ∈ ℙ(1 ‥ privacy_level) @inv3 shares_signatures ∈ ℙ(1 ‥ privacy_level) | |
@inv4 public_key ∈ BOOL @inv5 public_key_signatures ∈ ℙ(1 ‥ privacy_level) |
This file contains hidden or 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
length mismatch for ip 212.8.74.234 | |
([148993L, 149003L, 149099L], ['28c740f48d6ee8f065c3904137ab00748155992ce9abb1baffa7568bfae074f2', 'd2da4a8a2740a45f1c57bbc54a3d33d71e3bc515725a6fc2ee9118854b828cd2']) | |
length mismatch for ip 82.116.160.50 | |
([148329L, 148475L, 149693L, 149765L, 149778L], ['2e8c92a28103273b94d961a73ac8bf067dff4e6549274d103347807ef7a0de48', '68e611796ba83de1f2cae38fb067afecff44b0930f63bf2537dbb387f1a562f6', '9e683b11b857b7bf1d4e4fbc88d1fee8f8a87c29b3711bc2176d1f1b4eee9397', 'ad3c500a911fa13dc3640c7c41e1adaa08ea71654f490d54b7c65d5fd3a8bae7']) | |
Ip not in database 85.60.60.155 | |
length mismatch for ip 82.116.165.84 | |
([148121L, 148310L, 148322L, 149515L, 149520L], ['dc6910616a56cf57b779b8de4104183265271dae269fac3fa981ed3542ec6852', '666dbec4c768f33840b1ff1a7b868487d98e0af582fbd802c8547153e106862b', '78883c91f6180f79a4bc7d6ca0680f87387af113301d00d910d21bc3a599c73e', '78883c91f6180f79a4bc7d6ca0680f87387af113301d00d910d21bc3a599c73e']) | |
length mismatch for ip 213.98.84.22 | |
([148363L, 148376L, 148384L], ['ba |
This file contains hidden or 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
Sparked by recent event in politics a lot of debate and controversy has occurred on the spanish blogosphere | |
around a seemingly simple question of probability: | |
What is the probability that a Yes/No election with 3030 voters results in a tie? | |
Before suggesting answers, let me make it clear that the main controversy has ocurred | |
when trying to answer this question in its barest form, without any additional | |
information besides its simplest formulation above, _plus_ a binomial model for | |
voter choices. |