This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM mcr.microsoft.com/devcontainers/base:jammy | |
| USER vscode | |
| RUN curl -s "https://get.sdkman.io" | bash | |
| RUN chmod +x "$HOME/.sdkman/bin/sdkman-init.sh" | |
| RUN "$HOME/.sdkman/bin/sdkman-init.sh" | |
| # Java Env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| from watchdog.observers import Observer | |
| from watchdog.events import FileSystemEventHandler | |
| import os | |
| import sys | |
| from os import path | |
| import re | |
| """ | |
| Requirements : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Coderetreat @2023 - Arolla | |
| # vivant + <=1 voisin ----> Meurt | |
| # vivant + >=4 voisins ----> Meurt | |
| # vivant + {2, 3} voisins ----> Conserve son statut | |
| # vide + 3 voisins ----> Survit | |
| # Business | |
| # Il nous a demandé de modéliser la grille : | |
| # - en gardant uniquement les cellules vivantes | |
| # - rille sans bornes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Coderetreat @2023 - Arolla | |
| # Authors : NEB + AMEH | |
| # vivant + <=1 voisin ----> Meurt | |
| # vivant + >=4 voisins ----> Meurt | |
| # vivant + {2, 3} voisins ----> Conserve son statut | |
| # vide + 3 voisins ----> Survit | |
| # Business | |
| NEXT_STATE = { | |
| 0: (lambda _ : 0), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Coderetreat @2023 - Arolla | |
| # Authors : NEB + AMEH | |
| # vivant + <=1 voisin ----> Meurt | |
| # vivant + >=4 voisins ----> Meurt | |
| # vivant + {2, 3} voisins ----> Conserve son statut | |
| # vide + 3 voisins ----> Survit | |
| # Business | |
| # Il nous a demandé de modéliser la grille : | |
| # - en gardant uniquement les cellules vivantes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.lang.*; | |
| public class Main { | |
| record XY(int x, int y){} | |
| public static void main(final String[] args) throws Exception { | |
| //Variables | |
| int H=0, W=0; | |
| int[][] grid=null; | |
| //Read inputs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.lang.*; | |
| public class Main { | |
| final static int S=9; | |
| final static int E=18; | |
| final static int D=24; | |
| public static void main(final String[] args) throws Exception { | |
| //Variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //############## Bi-Directional ManyToMany JPA relationship ################################# | |
| class UsageCaseOne { | |
| @Entity | |
| class Foo { | |
| @Id | |
| private Long id; | |
| @ManyToMany(mappedBy = "foos") | |
| private Set<Bar> bars = new HashSet<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*SELECT sum(t.tablename, c.column_name) AS total | |
| FROM pg_catalog.pg_tables as t | |
| join information_schema.columns as c on c.table_name=t.tablename and c.data_type='integer' | |
| WHERE schemaname != 'pg_catalog' AND | |
| schemaname != 'information_schema';*/ | |
| -- SELECT 0 AS total; | |
| CREATE OR REPLACE FUNCTION pg_catalog.calcTotal () | |
| RETURNS BIGINT AS $$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Flowers(flowers, ww, wh, initH, maxH, maxR) { | |
| this.flowers = flowers; | |
| this.size = flowers.length; | |
| this.right = this.flowers[0]; | |
| this.left = this.flowers[this.size - 1]; | |
| this.windWidth = ww; | |
| this.windHeight = wh; | |
| this.initHeight = initH; | |
| this.maxHeight = maxH; | |
| this.maxR = maxR; |