Skip to content

Instantly share code, notes, and snippets.

View ruescasd's full-sized avatar

David Ruescas ruescasd

  • Sequent
View GitHub Profile
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})"
}
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)
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
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.
Modeling a binomial process with the beta binomial
Case 1: You have no information
This requires using a non-informative prior for the beta distribution. Normally this is done
with a uniform prior for all values of p, which corresponds to alpha = beta = 1.
Case 2: You have some prior information in terms of the mean and variance of p
You calculate alpha and beta, like in this post: http://stats.stackexchange.com/questions/12232/calculating-the-parameters-of-a-beta-distribution-using-the-mean-and-variance
import numpy.random as npr
SIZE=3030
LOOPS=1000000
TIE=SIZE/2
ties=0
for i in range(1, LOOPS):
p = npr.random()
/*
* A typed, purely functional, sequential state machine modeling a cake
*
* The cake has these states
*
* Started => Poured => Mixed => Baked
*
* Shows how to deal with state functionally and how impossible operations
* are compile time errors rather than runtime errors.
*
Error: Could not find or load main class vfork.ui.info.InfoTool
Traceback (most recent call last):
File "/home/eorchestra/venv/local/lib/python2.7/site-packages/frestq/tasks.py", line 1309, in post_task
task_output = task.run_action_handler()
File "/home/eorchestra/venv/local/lib/python2.7/site-packages/frestq/tasks.py", line 276, in run_action_handler
return self.action_handler_object.execute()
File "./create_election/director_jobs.py", line 66, in execute
election.threshold_parties, session_privpath)
File "./vmn.py", line 21, in go
return func(*args, **kwargs)
[
{
"q":"¿Cómo puedo votar?",
"a":"<p>En tres sencillos pasos:</p><ol><li><strong>Entra en app Podemos:</strong> Accede a la aplicación movil o web de Podemos, e introduce tu clave de acceso.</li><li><strong>Accede a la cabina de votación:</strong> Una vez hayas entrado en la aplicación de Podemos, te aparecerá un botón de votar, pincha y serás redirigido a la cabina de votación.</li><li><strong>Vota:</strong> Responde a las preguntas de la votación. Antes de emitir tu voto, podrás confirmar la respuestas que has elegido y tendrás oportunidad de modificarlas. Una vez hayas hecho esto, podrás confirmar y emitir tu voto.</li></ol>"
},
{
"q":"¿Quién puede votar?",
Traceback (most recent call last):
File "/home/eorchestra/frestq/frestq/protocol.py", line 175, in reserve_task
task_output = task.run_action_handler()
File "/home/eorchestra/frestq/frestq/tasks.py", line 278, in run_action_handler
return self.action_handler(self)
File "./create_election/performer_jobs.py", line 328, in generate_public_key
v_gen_public_key(session_privpath, output_filter)
File "./vmn.py", line 21, in go
return func(*args, **kwargs)
File "./vmn.py", line 48, in v_gen_public_key