Approval voting

Fri 22 April 2022
Children approving their teacher (Photo credit: Wikipedia)

This article is an update of the the previous one. It adds the approval voting method and fix few errors.

Method explanation

Each voter can apprrove as many candidate as he wants. It can be seen as a majority judgement with only two possible notes. It can also be presented as the same process as a time management system (such as doodle).


To compare with other methods, I start with the ballots for majority judgment and for each ballot approve all candidates whose note is above a threshold.

def jm_to_approval(jm_vote):
    """transform vote for "juement majoritaire" to approval list."""
    notes = MajorityJudgement.notes
    values = dict(zip(notes, range(7)))
    return [name for name, appr in jm_vote.items() if values[appr] < 4]

For the rest, simple counters are enough:

  • to count number for each candidate
  • to count the total number of voters

Graphical representation rely on plot bar.


The results can be different from the one from other voting methods. I'm surprised by the difference between Borda method and approval method. In Borda method, the candidates after the third one have really few points compared to the first ones. In the approval method, if a voter approve 4 candidates, all those candidates have the same approval (no distinction between them).

Approval method
Borda method (same votes)

This may also come from the threshold I put. I choose this threshold because I think a voter approve all the OK. Nevertheless, it seems the number of approval (archive) can be less than expected (less than 2 approval in average). I find this number really really low. Perhaps it is due to the political offer that does not correspond to voters expectations.

Category: python Tagged: geopolitics python vote

Voting method reflections

Fri 28 January 2022
Transparent voting box (Photo credit: Wikipedia)

This article presents personal thoughts on voting methods. More specifically, it presents guarantees offer by the traditional non-electronic voting method and won’t elaborate on electronic voting.


First, let’s define few specifications I’d like to develop.

  • any voter can understand how …

Category: reflections Tagged: geopolitics reflection vote

Read More

Mobile OS alternatives and european sovereignty

Tue 04 May 2021
Sailfish (not OS) (photo credit: wikipedia)

OS for mobile devices has evolved over the pasts years. Once, European actors (e.g. Nokia) were in lead position. Now it's hard to find non-android mobile OS. Each OS mobile comes with its software and hardware environements, and its geopolitical considerations.

Here is …

Category: tools Tagged: smartphone geopolitics

Read More

Cache implementation using weakref

Fri 30 April 2021
Bird's cache (Photo credit: Wikipedia)

This article presents a quick example of how to use weakref to implement a home-made cache mechanism.

Let's use the following use case:

  • Let's consider items:
    • items can be stored on a storage
    • items can be retrieved from storage
    • items are identify by an ID …

Category: how to Tagged: python cache weakref

Read More

Tkinter and Asyncio

Thu 18 February 2021
Asynchronous process results waiting (Photo credit: Wikipedia)

Graphical interfaces are typically the kind of object that can take advantage of asynchrounous programming as a GUI spend lot of time waiting for user input.

Tkinter <>_ is a kind of standard for graphical …

Category: how to Tagged: python asyncio

Read More

Latex generator using Jinja

Wed 11 November 2020
Kawasukune-jinja (Photo creadit: Wikipedia)

The goal is to generate a PDF file using python. I decided to generate \(\LaTeX\).


I decided to use jinja as its documentation mention it.

\begin{equation*} \boxed{\text{Jinja template}} \xrightarrow[\text{python}]{} \boxed{\LaTeX} \xrightarrow[\text{pdflatex}]{} \boxed{\text{PDF}} \end{equation*}

The …

Category: LaTeX Tagged: python LaTeX Jinja

Read More

Travis setup

Tue 12 May 2020
One job in continuous integration pipeline (Photo credit: Wikipedia)

The goal is to setup a CI pipeline based on Travis with external dependencies integrated to a Github repository

Travis basics

To enable Travis integration in Github, one must edit ./.travis.yml file.

I won't go into detail. The setup is …

Category: how to Tagged: travis ci how to

Read More
Page 1 of 11

Next »