Skip to content

Instantly share code, notes, and snippets.

View otrack's full-sized avatar

Pierre Sutra otrack

View GitHub Profile
package tsp.pacman;
import java.lang.Math;
class Position {
int row, col;
public Position(int row, int col) {
this.row = row;
@otrack
otrack / CI9.java
Last active December 12, 2024 12:02
import java.util.function.Function;
// 1
interface F {int call(); }
class Q1 {
public static void main(String[] args) {
F a = () -> {return 42;};
System.out.println(a instanceof F);
package tsp.ast;
class Add extends Operation {
Add(Node left, Node right) {
super(left, right);
}
@Override
public int execute() {
@otrack
otrack / soluce.sh
Last active November 26, 2024 08:44
#!/bin/sh
# setup.sh
MAX=1
PREFIX=semaphore_counter_
for r in cabine panier;
do
for i in $(seq 1 1 ${MAX})
do
class Monster {
String name;
int health;
public static void main(String args[]) {
Monster aMonster;
for (int i=0; i<8; i++) {
aMonster = Pokedex.createMonster("Pikachu"+i, 0);
Pokedex.displayMonster(aMonster);
}
class Monster {
String name;
int health;
public static void main(String args[]) {
Monster aMonster;
for (int i=0; i<8; i++) {
aMonster = Pokedex.createMonster("Pikachu"+i, 0);
Pokedex.displayMonster(aMonster);
}
#!/bin/bash
if [ -f arene.txt ];
then
while read pid;
do
kill -USR1 $pid
done < arene.txt
rm arene.txt
else
#!/bin/bash
trap 'echo $$: Morituri te salutant; exit 0' USR1
trap ./cesar.sh INT TERM
if [ $# -ne 1 ]; then
echo "Usage: $0 N"
exit 1
fi
# Cassandra storage config YAML
# NOTE:
# See https://cassandra.apache.org/doc/latest/configuration/ for
# full explanations of configuration directives
# /NOTE
# The name of the cluster. This is mainly used to prevent machines in
# one logical cluster from joining another.
https://db2cdn.fra1.cdn.digitaloceanspaces.com/assets/document/103_Carte_lieu_final.jpg
Dolines de Limère State Park