Linux/Windows dual boot on the XPS 13 9370 (2018)

Install AHCI drivers in Windows

Installing Linux (Ubuntu 16.04 in my case) requires (among other things) to switch the SATA operation to AHCI in the BIOS.

If you you do that without installing the AHCI drivers in Windows, it won’t be able to boot. The following procedure (source) will fix that:

  1. Run Command Prompt as an administrator
  2. Invoke a “Safe Mode” boot with the command:

  1. Restart the PC and enter your BIOS during bootup.
  2. Change from IDE to AHCI mode then Save & Exit.
  3. Windows 10 will launch in Safe Mode.
  4. Right click the Window icon and select to run the Command Prompt in Admin mode from among the various options.
  5. Cancel Safe Mode booting with the command:

  1. Restart your PC once more and this time it will boot up normally but with AHCI mode activated.

Then proceeed to the Linux installation.

Installing Linux

On boot, on the Dell logo, press F12 and open the BIOS setup.
Disable Secure Boot then install Ubuntu normaly.


Installing the Razer Core on Ubuntu 16.04

Step 0: Install Ubuntu

First, follow my previous tutorial to install Ubuntu on the Razer Blade Stealth. I’m using a fresh Ubuntu 16.04.3 64bit install on a Razer Balde Stealth (late 2016).

Step 1: Update the Intel drivers

Start by updating your Intel drivers:

Step 2: Set the kernel options

I had to fiddle a lot to make things work. One of the major problems I got is that the machine wouldn’t properly suspend/shutdown/reboot/logout when I was using the integrated GPU witht the NVIDIA drivers installed.

At some point, I found this seamingly related issue on Bumblebee’s GitHub so I started playing with the kernel ACPI options. And I did not reproduce my issue with the following modifications… so maybe this step is useful, maybe it’s not.

Anyway, edit the value of  GRUB_CMDLINE_LINUX_DEFAULT  in  /etc/default/grub :

Update grub by calling update-grub  then reboot.

Step 3: Install the NVIDIA drivers

Then follow this tutorial to install the NVIDIA’s proprietary drivers version 384.59 and reboot.

Voilà! You should be able to use the descrete GPU and it should be listed in the NVIDIA X Server Settings (GTX 1080) in my case:

Step 4: Disable suspend when plugged in

For your information, I compiled a little recap of the last 3 versions available:

As you can see, things are getting better and version 384.59 appears to be the most functionnal so far.

But we’re not there yet: suspend “works” but it won’t resume properly. But the good thing with the Razer Core is that it provides both the discrete GPU and power. So using the NVIDIA driver implies the machine is plugged in. A simple solution is then to simply change the power options to never suspend when the machine is plugged in.

The “Jugement Majoritaire 2017” Experiment


The CNRS (“Centre National de la Recherche Scientifique”, the French national center for scientific research), the Dauphine and Polytechnique schools and 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:

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 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 – 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 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++.


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…


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.


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.