First, let's prepare Nix.
Get Nix source code and the C API branch:
git clone https://github.com/NixOS/nix.git
cd nix
git remote add tweag https://github.com/tweag/nix.git
git checkout nix-c-bindings
# Power 4 | |
# two players | |
# one grid: 7 columns, 6 rows | |
# turn by turn | |
# each turn: put a coin at the top of a column, | |
# it falls and reaches the lowest available row in the column | |
# display ~ | |
from dataclasses import dataclass |
# This file `obj.txt` is a hexdump with comments to manually build an ELF file. | |
# Lines starting with '#' are comments. | |
# The rest is read as per `xxd -r -p` (see `man xxd`) | |
# You can build the binary executable `obj.elf` using the command: | |
# ```bash | |
# <obj.txt grep -v '^#' | xxd -r -p >obj.elf | |
# ``` | |
# You can then use chmod to make `obj.elf` executable. | |
# ================== |
First, let's prepare Nix.
Get Nix source code and the C API branch:
git clone https://github.com/NixOS/nix.git
cd nix
git remote add tweag https://github.com/tweag/nix.git
git checkout nix-c-bindings
# usage: | |
# NIXPKGS_FLAKE_REF="github:nixos/nixpkgs/master" nix eval --json --file "./nixpkgs-graph.nix" | |
let | |
nixpkgsFlakeRef = builtins.getEnv "NIXPKGS_FLAKE_REF"; | |
pkgs = import (builtins.getFlake nixpkgsFlakeRef) { }; | |
in | |
with pkgs.lib; |
curl -s 'https://graphics.afpforum.com/data/presidential-fr-2022-live-constantes/communes_codes.json' | jq -c '.[]' \ | |
| while read commune_dict | |
do | |
code=$(echo "$commune_dict" | jq -r '.c') | |
nom=$(echo "$commune_dict" | jq -r '.n') | |
curl -sq "https://graphics.afpforum.com/data/presidential-fr-2022-live-results/resultats1/communes/IR1_$code.json" \ | |
| jq --arg code "$code" -c '.lesResultats | map({key: .individuNom, value: .resPourCent}) | from_entries | . + {code: $code}' \ | |
>> "resultats.json" | |
done |
EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
for dir in ~/.vscode-server*/bin/* | |
do | |
node=$dir/node | |
echo Fixing $node | |
rm -v $node | |
ln -vs $(which node) $node | |
rm -vf $dir/vscode-remote-lock* | |
done | |
GCCLIB=$(dirname $(gcc -print-file-name=libstdc++.so.6)) |
La pratique se fait en binôme, avec 2 ordinateurs par binôme (1 ordinateur par personne).
L'objectif est de montrer comment git permet de travailler collaborativement, et comment gérer les conflits lors de l'intégration des changements distants.
Dans ce TP nous abordons les notions suivantes:
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Run server (dev)", | |
"type": "node-terminal", | |
"request": "launch", |