The “Jugement Majoritaire 2017” Experiment

TL;DR

The CNRS (“Centre National de la Recherche Scientifique”, the French national center for scientific research), the Dauphine and Polytechnique schools and LaPrimaire.org have teamed up to deploy Cocorico, an online blockchain-powered voting platform I’ve been developping for #MAVOIX, to test a new voting mecanism: the “majority judgment” (or “jugement majoritaire” in French).

They’ve decided to allow people to vote for the actual candidates to the French presidential election of 2017 using this new majority judgment technique. You can participate to this experiment here:

https://www.jugementmajoritaire2017.com/

After just one year in the works, Cocorico is being endorsed by prestigious organisms such as the CNRS, Dauphine and Polytechnique as a tool to power their latest research in voting. I’m very proud and I think it opens the way for a wider approval and a bigger community around Cocorico, which I believe to be one of the core projects to move toward a more direct and efficient democracy.

About the majority judgement

This new mecanism is called majority judgment (“jugement majoritaire” in French). Here is an overview:

In Majority Judgment, Michel Balinski and Rida Laraki argue that the traditional theory of social choice offers no acceptable solution to the problems of how to elect, to judge, or to rank. […] It is at once meaningful, resists strategic manipulation, elicits honesty, and is not subject to the classical paradoxes encountered in practice, notably Condorcet’s and Arrow’s. They offer theoretical, practical, and experimental evidence—from national elections to figure skating competitions—to support their arguments. […]

Majority Judgment on The MIT Press

What makes the majority judgment so special and so meaningful is that each voter scores each candidate.

How it works inside Cocorico

First, Cocorico was not meant to be used for this kind of votes. It was designed to feature simple yes/no/blank votes. We made the corresponding changes for LaPrimaire.org second round.

There were three main changes :

  1. We had to be able to customize the question asked to the voters. In a majority judgment vote, voters are asked a specific question such as “considering all the facts, to the best of my knowledge, I judge the following candidate for the 2017 French presidential election to be…” followed by the voting form.
  2. We had to be able to customize a list of candidates. To keep it generic, Cocorico handle thoses as “proposals”.
  3. We had to be able to customize a set of mentions (“passable”, “good”, “very good”…) the voter could chose from for each candidate. To keep it generic, Cocorico handle thoses as “choices”.

In the end, each vote is defined by :

  • one question
  • n proposals (one candidate per proposal)
  • m choices (mentions)

Therefore, each ballot is a array of n integers, where:

  • the index in the array is the index of the candidate (first candidate is element 0, second candidate is element 1, …);
  • the integer value in the corresponding array cell is the index of the mention the voter chose for that candidate.

Let’s say we have 4 candidates (A, B, C and D) and 3 mentions (“passable”, “good” and “very good”). Then the following ballot:

  • A: good
  • B: very good
  • C: passable
  • D: good

will translate into the following array representation:

1 2 0 1

This array value is then sent on the blockchain (Ethereum in Cocorico’s case) as a smart-contract method call transaction:

The code is trivial: after a bounds check, for each cell of the array, we simply increment the corresponding mention by one if a persistent result array.

Voting as a Service

This experiment is the definitive validation of the “Voting as a Service” bet I took with Cocorico a year ago: the platform provides a documented – soon to be public – API for thirds party app developers – such as LaPrimaire.org – to create and manage votes.

Developers can then embed a “Vote” button – pretty much like Facebook’s “Like” button – in any content. When the voter clicks on that “Vote” button, Cocorico’s blockchain voting widget opens and handles the whole voting process.

In the case of this experiment, the voting button is embedded in a new kind of content: a Facebook bot. I’m not sure why they chose to use a Facebook bot. But what I’m sure about is that I’m glad I didn’t have to care about any of this. The whole “voting as a service” API worked just the same! To make sure Facebook users did not have to re-authenticate on the voting platform, the Facebook bot passes already known/authenticated users by leveraging Cocorico’s external user database mecanism.

The experiment development team barely asked me anything: they knew the platform already, they had all the required documentation and it was easy enough to use.

It’s transparent for the voters and pain-free for the developers. And it works. 

Ubuntu on the Razer Blade Stealth (late 2016)

I received my Razer Blade Stealth (late 2016) last week. I needed to install Ubuntu to work on some of my projects and to use as my “private stuff” OS (as-opposed to my “company stuff OS”, which is Windows). So I installed Ubuntu as a dual boot alongside Windows 10. Here is how I did it.

  1. Shrink the Windows partition.
  2. Download the Ubuntu 16.10 iso file.
  3. Create a bootable Ubuntu USB drive using UNetbootin.
  4. Install Ubuntu.

Then, you’ll probably notice Ubuntu gets stuck in a suspend/resume loop when you close and reopen the lid. To fix this, add “button.lid_init_state=open” to the grub boot parameters and update grub.

Atom plugins for C++ development

I work a lot on Ubuntu, and Linux is one of the targets of Minko. As soon as Github’s Atom was released, I wanted to test it as an actual development environment for such C++ applications.

Here are two plugins I think are major additions to Atom for C++ development.

autocomplete-clang

Autocomplete is a major feature for any IDE. In the case of C++, it’s even more important because of the complexity of the language. The autocomplete-clang plugin uses clang static analysis to parse headers. It then extends Atom’s autocomplete feature to properly autocomplete C++.

autocomplete-clang

The plugin works great. It’s less tightly integrated than VisualStudio’s Intellisense. So it’s not as fast. Still, the lack of speed is not a big issue compared to the ease the plugin brings. Using pre-compiled headers should speed things up, but I haven’t tried them yet: I guess it says a lot about how not much of a problem this lack of performance might be…

linter-clang

Compiling your code to check its syntax is not a very efficient process. You keep Alt-Tabing between your editor and the terminal where you run compilation. It’s a given clang’s output is a lot more readable than GCC’s. Still, it’s not as integrated as VisualStudio real-time analysis.

linter-clang

The linter-clang plugin fixes that. Once again, it uses clang’s static analysis to check your code and properly report errors in real-time. No need to try to compile your code: linter-clang will check for errors as you type and will report them visually directly in the editor, just like Eclipse or VisualStudio do it.

Using those plugins with Minko

Both those plugins will need to call clang with the proper flags. And those flags depend on your very project. In the case of autocomplete-clang, those flags can be setup in a .clang_complete files at the root of your project (this method is actually inspired from Vim’s popular clang autocomplete plugin). But linter-clang does not support .clang_complete files, so I made a patch available here (that patch will hopefully be merged soon as you can read here).

To generate such .clang_complete files, Minko’s build system has been updated with a “clang-complete” action. This action will automatically create the .clang_complete files for each Minko project (the core framework, the plugins, the tutorials…) or your own project with a single command line :

Instead of solution/project files, this premake action will generate .clang_complete files with each project’s specific flags.

XPS 13 “Developer Edition” Microphone Fix

It seems the microphone doesn’t work out of the box on the XPS 13 “Developer Edition”. Worse, you’ll actually need to re-compile your kernel to make it work… at least the patches are easy to find thanks to Dell’s “Project Sputnik” leader Barton George:

I used those on the Linux 4.0.2 (stable) kernel, recompiled, installed… and voilà! The microphone works!

Hopefully those fixes will soon be in the kernel main line…

XPS13 “Developer Edition”: Updating the graphics driver

Update: I previously indicated to use the “xorg-edgers” PPA. But it’s far too brutal since it will update a lot of other things (such as the X server) and it might just break. I now recommend using the Oibaf PPA to update only the drivers.

Following my article about a few “out of the box” fixes for the XPS 13 “Developer Edition”, I wanted to upgrade the Intel graphics driver and Mesa. Indeed, I noticed some issues with 3D apps:

  • most games were incredibly slow, or at least a lot slower than what ohter got with the same hardware on Windows (and OpenGL performance are supposed to be on-par or close – if not better – on Linux now);
  • WebGL was not available neither on Chromium nor Firefox, even through their latest stable version.

The pre-installed version of Mesa (10.1.3) is pretty old (May 2014). You can upgrade it to the latest version along with the latest Intel drivers using the “xorg-edgers” PPA the Oibaf “Updated and Optimized Open Graphics Drivers” PPA.

Updating the i915 drivers and Mesa should give you a very important performance boost on 3D apps. I noticed “Counter Strike: Global Offensive” went from barely playable to completely smooth. I also noticed WebGL is now properly available on both Firefox and Chrome.