commit 06bf5f94887195c41f66b6988194d9391653c4ad Author: Wamster Date: Thu Oct 12 16:39:49 2023 +0200 septembre + octobre diff --git a/Anglish/.~lock.Best_Companies_to_Work.docx# b/Anglish/.~lock.Best_Companies_to_Work.docx# new file mode 100644 index 0000000..ecbedee --- /dev/null +++ b/Anglish/.~lock.Best_Companies_to_Work.docx# @@ -0,0 +1 @@ +,wamster,salle223-04,18.09.2023 11:47,file:///export/home/an22/wamster/.config/libreoffice/4; \ No newline at end of file diff --git a/Anglish/AMMARAG2Crypto2.docx b/Anglish/AMMARAG2Crypto2.docx new file mode 100755 index 0000000..2a70881 Binary files /dev/null and b/Anglish/AMMARAG2Crypto2.docx differ diff --git a/Anglish/Best_Companies_to_Work.docx b/Anglish/Best_Companies_to_Work.docx new file mode 100755 index 0000000..8afcafe Binary files /dev/null and b/Anglish/Best_Companies_to_Work.docx differ diff --git a/Anglish/FMO_transitive_verb.docx b/Anglish/FMO_transitive_verb.docx new file mode 100755 index 0000000..101f5eb Binary files /dev/null and b/Anglish/FMO_transitive_verb.docx differ diff --git a/Anglish/Monthly ice cream sales.docx b/Anglish/Monthly ice cream sales.docx new file mode 100755 index 0000000..90fd2ed Binary files /dev/null and b/Anglish/Monthly ice cream sales.docx differ diff --git a/Anglish/ReponseQuestion.docx b/Anglish/ReponseQuestion.docx new file mode 100755 index 0000000..1233c8e Binary files /dev/null and b/Anglish/ReponseQuestion.docx differ diff --git a/Anglish/Resume podcast.docx b/Anglish/Resume podcast.docx new file mode 100755 index 0000000..7593a4c Binary files /dev/null and b/Anglish/Resume podcast.docx differ diff --git a/Anglish/WAMSTERG2FormMetaverseDebate.docx b/Anglish/WAMSTERG2FormMetaverseDebate.docx new file mode 100755 index 0000000..a62dff7 Binary files /dev/null and b/Anglish/WAMSTERG2FormMetaverseDebate.docx differ diff --git a/Anglish/Wamster+ Toolbox+ G2.docx b/Anglish/Wamster+ Toolbox+ G2.docx new file mode 100755 index 0000000..31be722 Binary files /dev/null and b/Anglish/Wamster+ Toolbox+ G2.docx differ diff --git a/Anglish/WamsterG2Crypto2.docx b/Anglish/WamsterG2Crypto2.docx new file mode 100755 index 0000000..63de239 Binary files /dev/null and b/Anglish/WamsterG2Crypto2.docx differ diff --git a/Anglish/WamsterG2crypto.docx b/Anglish/WamsterG2crypto.docx new file mode 100755 index 0000000..c13ae3b Binary files /dev/null and b/Anglish/WamsterG2crypto.docx differ diff --git a/Anglish/WamsterMollaWillatteG2MCQ.docx b/Anglish/WamsterMollaWillatteG2MCQ.docx new file mode 100755 index 0000000..2155e18 Binary files /dev/null and b/Anglish/WamsterMollaWillatteG2MCQ.docx differ diff --git a/Anglish/adjectif.txt b/Anglish/adjectif.txt new file mode 100755 index 0000000..5425bc6 --- /dev/null +++ b/Anglish/adjectif.txt @@ -0,0 +1,35 @@ + + + + + + |-----------------| + | LES ADJECTIFS | + |-----------------| + + + + + + |-------------------------------------------------------|-----| + |thrill / to be thrilled | + | + |-------------------------------------------------------|-----| + |belief / optimism / to be optimistic | + | + |-------------------------------------------------------|-----| + |anxiety | - | + |-------------------------------------------------------|-----| + |denial / hope(=espoir) / to be hopeful vs hopeless | + | + |-------------------------------------------------------|-----| + |panic / anxiety | - | + |-------------------------------------------------------|-----| + |euphoria | + | + |-------------------------------------------------------|-----| + |capitulation / anger | - | + |-------------------------------------------------------|-----| + |disapointment / to be disappointed | - | + |-------------------------------------------------------|-----| + + +terrorisme +énergie +spéculation \ No newline at end of file diff --git a/Anglish/amawam.docx b/Anglish/amawam.docx new file mode 100755 index 0000000..1378d6f Binary files /dev/null and b/Anglish/amawam.docx differ diff --git a/Anglish/english_question.08.03.23.docx b/Anglish/english_question.08.03.23.docx new file mode 100755 index 0000000..0f2dc79 Binary files /dev/null and b/Anglish/english_question.08.03.23.docx differ diff --git a/Anglish/graph.docx b/Anglish/graph.docx new file mode 100755 index 0000000..4e34f49 Binary files /dev/null and b/Anglish/graph.docx differ diff --git a/Anglish/noir_us_force.docx b/Anglish/noir_us_force.docx new file mode 100755 index 0000000..596f404 Binary files /dev/null and b/Anglish/noir_us_force.docx differ diff --git a/Anglish/note.docx b/Anglish/note.docx new file mode 100755 index 0000000..32a74f3 Binary files /dev/null and b/Anglish/note.docx differ diff --git a/Anglish/phraseBiezzard.txt b/Anglish/phraseBiezzard.txt new file mode 100755 index 0000000..9911713 --- /dev/null +++ b/Anglish/phraseBiezzard.txt @@ -0,0 +1,19 @@ +... you ... Thai food before? | +a) have / eaten | +b) has / eaten | +c) will / eat | + | + | +-----------------------------------------------------------------| +My dad [...] me | +a) left | +b) has left | +c) has leave | + | +-----------------------------------------------------------------| +My mother [...] me that my litlle brother [...] kidnap by my dad.| +a) has told, has been | +b) has asked, have been | +c) has told, has | +d) has asked, has | +-----------------------------------------------------------------| \ No newline at end of file diff --git a/Anglish/wamsterG2emotionscomp.docx b/Anglish/wamsterG2emotionscomp.docx new file mode 100755 index 0000000..92a935b Binary files /dev/null and b/Anglish/wamsterG2emotionscomp.docx differ diff --git a/Anglish/~$note.docx b/Anglish/~$note.docx new file mode 100755 index 0000000..a0895ac Binary files /dev/null and b/Anglish/~$note.docx differ diff --git a/BD/TP01_Requetes_avec_agregats.txt b/BD/TP01_Requetes_avec_agregats.txt new file mode 100755 index 0000000..e8ba852 --- /dev/null +++ b/BD/TP01_Requetes_avec_agregats.txt @@ -0,0 +1,33 @@ +SELECT Region, COUNT(ALL NumVin) +FROM Vin +GROUP BY Region; + + +SELECT NUMVITIC, NOM, COUNT(ALL CRU) +FROM VITICULTEUR NATURAL JOIN VIN +GROUP BY NUMVITIC, NOM + + +SELECT NOM, NUMBUVEUR,AVG(ALL QTTE) +FROM BUVEUR NATURAL JOIN COMMANDE +WHERE VILLE='PARIS' +GROUP BY NOM, NUMBUVEUR; + + +SELECT NOM, COUNT(*) +FROM BUVEUR NATURAL JOIN COMMANDE +GROUP BY NOM; + + +SELECT NOM, SUM(ALL QTTE) +FROM BUVEUR NATURAL JOIN COMMANDE +GROUP BY NOM +HAVING AVG(ALL QTTE) >= 12; + + +SELECT NOM, NUMVITIC +FROM VITICULTEUR NATURAL JOIN VIN +GROUP BY NOM, NUMVITIC +HAVING COUNT(DISTINCT CRU) >= 2; + + diff --git a/BD/TP2.16.03.2023.txt b/BD/TP2.16.03.2023.txt new file mode 100755 index 0000000..c613950 --- /dev/null +++ b/BD/TP2.16.03.2023.txt @@ -0,0 +1,32 @@ +Q1) +CREATE VIEW VinDesViticulteurs (idVin, Cru, idViticulteur, NomViticulteur) +AS SELECT NumVin, Cru, NumVitic, Nom +FROM Vin natural join Viticulteur +WHERE Region='BOURGOGNE'; + +Q2) +CREATE VIEW CommandeBuveur(num, nom, nbCommande) +AS SELECT NumBuveur, Nom, COUNT(*) +FROM Buveur NATURAL JOIN Commande +GROUP BY NumBuveur, Nom; + +Q3) +SELECT NumVitic, Nom +FROM Viticulteur NATURAL JOIN Vin +WHERE NumVin IN(SELECT NumVin FROM Commande); + +Q4) +SELECT NumVitic, Nom +FROM Viticulteur +WHERE NumVitic NOT IN(SELECT NumVitic FROM Vin NATURAL JOIN Commande); + +Q5) +SELECT NumVitic, Nom +FROM Viticulteur NATURAL JOIN Vin NATURAL JOIN Commande +WHERE Ville='PARIS' +INTERSECT +SELECT NumVitic, Nom +FROM Viticulteur NATURAL JOIN Vin NATURAL JOIN Commande +WHERE Ville='MACON' + +Q6) diff --git a/BD/TP4_BD_29.03.2023.txt b/BD/TP4_BD_29.03.2023.txt new file mode 100755 index 0000000..2f20713 --- /dev/null +++ b/BD/TP4_BD_29.03.2023.txt @@ -0,0 +1,37 @@ +CREATE TABLE AEROPORT +(codeAeroport VARCHAR(15) PRIMARY KEY, +nom Varchar(40), +ville Varchar(40), +pays Varchar(40) +); + +Create table VOL +(numVol number primary key, +compagnie varchar(40), +periodeVol varchar(30) +); + +create table TYPE_AVION +(nomType varchar(40) primary key, +maxSieges number, +nomConstructeur varchar(40) +); + +create table AVION +(idAvion number primary key, +totalSieges number, +nomTypeAvion varchar(40) references TYPE_AVION +); + +create table PEUT_ATTERRIR +(nomTypeAvion varchar(40) references TYPE_AVION, +codeAeroprot varchar(15) references AEROPORT, +Primary key(nomTypeAvion, codeAeroprot) +); + +create table PERSONEL +(idPersonne number primary key, +nom varchar(40), +prenom varchar(40), +fonction varchar(40) +); \ No newline at end of file diff --git a/BD/TP5_BD_29.03.2023.txt b/BD/TP5_BD_29.03.2023.txt new file mode 100755 index 0000000..f36acc4 --- /dev/null +++ b/BD/TP5_BD_29.03.2023.txt @@ -0,0 +1,104 @@ + +Q1) +CREATE TABLE AUTEUR +NumAuteur number primary key, +NomAuteur Varchar(20) +); + +Insert into AUTEUR +VALUES +(1,'wamster'); +Insert into AUTEUR +VALUES +(2,'Wiliatt'); +Insert into AUTEUR +VALUES +(3,'Schnur'); +Insert into AUTEUR +VALUES +(4,'JKwroling'); +Insert into AUTEUR +VALUES +(5,'Squeezie'); +Insert into AUTEUR +VALUES +(6,'Lov'); +Insert into AUTEUR +VALUES +(7,'Apolinaire'); + + +CREATE TABLE EDITEUR +(CodeEditer number primary key, +RaisonSociale Varchar(50) +); + +Insert into EDITEUR +VALUES (1,'FOU'); +Insert into EDITEUR +VALUES (2,'RIEN'); +Insert into EDITEUR +VALUES (3,'PERSONNE'); +Insert into EDITEUR +VALUES (4,'INTELLIGENT'); +Insert into EDITEUR +VALUES (5,'SKIZOFRIEND'); + + + +2) +---------------------------------------------- +RAPPEL: + (type_attribut> REFERENCES +(ON DELETE / ON UPDATE) (CASCADE / SET DEFAULT / SET NULL) +---------------------------------------------- + +CREATE TABLE LIVRE +(NumLivre number primary key, +Titre Varchar(60), +CodeEditeur number references EDITEUR ON DELETE SET NULL +); + +INSERT INTO LIVRE +VALUES (1,'Harry Potter',4); +INSERT INTO LIVRE +VALUES (2,'Tournes la page',3); +INSERT INTO LIVRE +VALUES (3,'Roger et ses humains',3); +INSERT INTO LIVRE +VALUES (4,'devenir courreur pro en 10 conseils',1); +INSERT INTO LIVRE +VALUES (5,'geu',1); + +DELETE FROM EDITEUR WHERE RaisonSociale='PERSONNE'; + +SELECT * +FROM LIVRE; + + + +3) + +CREATE TABLE A_ECRIT +(NumAuteur number references AUTEUR ON DELETE SET NULL, +NumLivre number references LIVRE ON DELETE CASCADE, +Primary key(NumAuteur,NumLivre) +); + +INSERT INTO A_ECRIT +VALUES (1,4); +INSERT INTO A_ECRIT +VALUES (2,5); +INSERT INTO A_ECRIT +VALUES (4,1); +INSERT INTO A_ECRIT +VALUES (5,2); +INSERT INTO A_ECRIT +VALUES (6,3); + +DELETE FROM Livre WHERE Titre='devenir courreur pro en 10 conseils'; +SELECT * FROM A_ECRIT; + + +DELETE FROM AUTEUR WHERE NomAuteur='Lov'; + diff --git a/BD/TP_BD_06.04.2023.txt b/BD/TP_BD_06.04.2023.txt new file mode 100755 index 0000000..78a891c --- /dev/null +++ b/BD/TP_BD_06.04.2023.txt @@ -0,0 +1,89 @@ +connection: wamster iut ora2 nomal + +Q1)---------------------------------------------------------------------------------------------------------------- +CREATE USER wamster_prop1 identified by iut default tablespace datausers4F temporary tablespace temp; +CREATE USER wamster_prop2 identified by iut default tablespace datausers4F temporary tablespace temp; +grant connect, resource to wamster_prop1, wamster_prop2 + +Q2)a)---------------------------------------------------------------------------------------------------------------- +create table Client( +login varchar2(20) primary key, +nomClient varchar2(30), +prenomClient varchar2(30) +); + +create table Film( +numFilm integer primary key, +nomFilm varchar2(30) +); + +create table Location( +login varchar2(20) references Client, +numFilm integer references Film, +dateLocation Date, +primary key(login,numFilm) +); + +b) +insert into Client +values ('WAMSTER_PROP1', 'Wamster', 'Willy'); +insert into Client +values ('WAMSTER_PROP2', 'Wamster', 'Marty'); +insert into Client +values ('WAMSTER', 'Wamster', 'Alexis'); + +insert into Film +values (0, 'Harry Poter'); +insert into Film +values (1, 'L''armée des 12 singes'); +insert into Film +values (2, 'Avenger: infinity war'); + +insert into Location +values('WAMSTER_PROP1',2,'13-12-2002'); +insert into Location +values('WAMSTER_PROP1',1,'12-12-2012'); +insert into Location +values('WAMSTER_PROP2',2,'12-01-2008'); +insert into Location +values('WAMSTER_PROP2',1,'20-02-2002'); +insert into Location +values('WAMSTER',0,'28-05-2004'); +insert into Location +values('WAMSTER',1,'11-11-2011'); + +c) +create view Mes_Locations +as select nomClient, numFilm, dateLocation +From Client natural join Location +where login=user; +grant select on Mes_Locations to public; + +Q3)---------------------------------------------------------------------------------------------------------------- +select * from Client; => table inexistante + +select * from wamster_prop1.Client; + +Q4)a)---------------------------------------------------------------------------------------------------------------- +grant select on Mes_Locations to wamster_prop2; +grant select,insert,update on Location to wamster_prop2; +create view VClient +as select nomClient, prenomClient +from Client; +grant insert,update on VClient to wamster_prop2; +grant insert on Film to wamster_prop2; + +b) +select * from wamster_prop1.Mes_Locations; + +c) +insert into wamster_prop1.Film +values (3,'Les aventures de Jordan'); +insert into wamster_prop1.Client +values ('koumbisamba','Cyril','Koumbisamba'); +delete from wamster_prop1.Client +where login='koumbisamba'; +delete from wamster_prop1.Film +where numFilm=3; + + diff --git a/DEV/DEV3.1/TP01_BD/.bashrc b/DEV/DEV3.1/TP01_BD/.bashrc new file mode 100644 index 0000000..3e7b913 --- /dev/null +++ b/DEV/DEV3.1/TP01_BD/.bashrc @@ -0,0 +1,2 @@ +alias javacdb='javac -cp ".:/export/documents/mariadb-client.jar"' +alias javadb='java -cp ".:/export/documents/mariadb-client.jar"' diff --git a/DEV/DEV3.1/TP01_BD/.bashrc~ b/DEV/DEV3.1/TP01_BD/.bashrc~ new file mode 100644 index 0000000..5746467 --- /dev/null +++ b/DEV/DEV3.1/TP01_BD/.bashrc~ @@ -0,0 +1 @@ +alias javacdb='java -cp ".:/export/documents/mariadb-client.jar"' diff --git a/DEV/DEV3.1/TP01_BD/Q1Main.class b/DEV/DEV3.1/TP01_BD/Q1Main.class new file mode 100644 index 0000000..df90512 Binary files /dev/null and b/DEV/DEV3.1/TP01_BD/Q1Main.class differ diff --git a/DEV/DEV3.1/TP01_BD/Q1Main.java b/DEV/DEV3.1/TP01_BD/Q1Main.java new file mode 100644 index 0000000..62e7888 --- /dev/null +++ b/DEV/DEV3.1/TP01_BD/Q1Main.java @@ -0,0 +1,116 @@ +import org.mariadb.jdbc.*; +import java.sql.*; + +public class Q1Main{ + public static void main(String[] args) { + if (args.length < 1){ + System.out.println("Arguments invalide"); + System.exit(0); + } + String pays = args[0]; + try{ + int idPays = -1; + Connection cnx = DriverManager.getConnection( + "jdbc:mariadb://dwarves.iut-fbleau.fr/wamster", + "wamster","32201909"); + try { + Class.forName("org.mariadb.jdbc.Driver"); + } + catch(ClassNotFoundException e){ + System.out.println("ClassNotFoundException"); + cnx.close(); + System.exit(0); + } + + + // recuperation de l'id du pays entree en ligne de commande + try { + PreparedStatement pst = cnx.prepareStatement( + "SELECT idPays FROM DEV31TP01Q1_ListePays WHERE nomPays=?"); + pst.setString(1, pays); + ResultSet rs = pst.executeQuery(); + pst.close(); + if (rs.next()){ + idPays = rs.getInt("idPays"); + } + rs.close(); + if (idPays == -1){ + System.out.println("Pays inconnus"); + System.exit(0); + } + } + catch(SQLException e){ + System.out.println("probleme de select 1"); + cnx.close(); + System.exit(0); + } + + // recuperation des score du pays + try { + PreparedStatement pst = cnx.prepareStatement( + "SELECT * FROM DEV31TP01Q1_score WHERE idCompetiteurs=?"); + pst.setInt(1, idPays); + ResultSet rsid = pst.executeQuery(); + pst.close(); + int scoreTotal = 0; + + //recuperation du nom du votant à partir de son id + try{ + pst = cnx.prepareStatement( + "SELECT nomPays FROM DEV31TP01Q1_ListePays WHERE idPays=?"); + while (rsid.next()){ + int idVotant = rsid.getInt("idVotants"); + int score = rsid.getInt("score"); + String nomVotant = null; + pst.setInt(1, idVotant); + ResultSet rsnom = pst.executeQuery(); + if (rsnom.next()){ + nomVotant = rsnom.getString("NomPays"); + } + rsnom.close(); + + // affichage du score qu'a donne le votant (aligner proprement) + System.out.print(nomVotant); + int espaceAAjouter = 20 - (nomVotant.length() + Integer.toString(score).length()); + for (int i=0; i bestScore){ + bestScore = score; + bestPays = nomPays; + } + } + rsCompetiteur.close(); + pstCompetiteur.close(); + if (idPays == -1){ + cnx.close(); + return null; + } + cnx.close(); + return new String[] {bestPays, Integer.toString(bestScore)}; + } + catch(SQLException e){ + cnx.close(); + return null; + } + } + catch(SQLException e){ + return null; + } + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP01_BD/Q2Evenement.class b/DEV/DEV3.1/TP01_BD/Q2Evenement.class new file mode 100644 index 0000000..8d3bb32 Binary files /dev/null and b/DEV/DEV3.1/TP01_BD/Q2Evenement.class differ diff --git a/DEV/DEV3.1/TP01_BD/Q2Evenement.java b/DEV/DEV3.1/TP01_BD/Q2Evenement.java new file mode 100644 index 0000000..6693949 --- /dev/null +++ b/DEV/DEV3.1/TP01_BD/Q2Evenement.java @@ -0,0 +1,22 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q2Evenement implements ActionListener{ + public JLabel pays; + public JLabel score; + + public Q2Evenement(JLabel pays, JLabel score){ + this.pays = pays; + this.score = score; + } + + @Override + public void actionPerformed(ActionEvent evenement){ + String[] bestPays = Q2BestPays.bestPays(); + if (bestPays != null){ + this.pays.setText(bestPays[0]); + this.score.setText(bestPays[1]); + } + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP01_BD/Q2Main.class b/DEV/DEV3.1/TP01_BD/Q2Main.class new file mode 100644 index 0000000..71aab5c Binary files /dev/null and b/DEV/DEV3.1/TP01_BD/Q2Main.class differ diff --git a/DEV/DEV3.1/TP01_BD/Q2Main.java b/DEV/DEV3.1/TP01_BD/Q2Main.java new file mode 100644 index 0000000..72b2534 --- /dev/null +++ b/DEV/DEV3.1/TP01_BD/Q2Main.java @@ -0,0 +1,35 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q2Main{ + public static void main(String[] args) { + + JFrame fenetre = new JFrame("Question 2"); + fenetre.setSize(300, 200); + fenetre.setLocation(700, 300); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JLabel labelPays = new JLabel("", JLabel.CENTER); + JLabel labelScore = new JLabel("", JLabel.CENTER); + + JButton bouton = new JButton("o"); + JPanel bas = new JPanel(new BorderLayout()); + bas.add(bouton,BorderLayout.EAST); + + String[] bestPays = Q2BestPays.bestPays(); + if (bestPays != null){ + labelPays.setText(bestPays[0]); + labelScore.setText(bestPays[1]); + } + + fenetre.add(labelPays, BorderLayout.NORTH); + fenetre.add(labelScore, BorderLayout.CENTER); + fenetre.add(bas, BorderLayout.SOUTH); + + Q2Evenement evenementBouton = new Q2Evenement(labelPays, labelScore); + bouton.addActionListener(evenementBouton); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP01_BD/Question1.java~ b/DEV/DEV3.1/TP01_BD/Question1.java~ new file mode 100644 index 0000000..0d6a50b --- /dev/null +++ b/DEV/DEV3.1/TP01_BD/Question1.java~ @@ -0,0 +1,56 @@ +import org.mariadb.jdbc.*; + +public class Q1Main{ + public static void main(String[] args) { + if (args.length < 1){ + System.out.println("Arguments invalide"); + return 0; + } + String pays = args[0]; + try{ + Connection cnx = DriverManager.getConnection( + "jdbc:mariadb://dwarves.iut-fbleau.fr/wamster", + "wamster","..."); + try { + Class.forName("org.mariadb.jdbc.Driver"); + } + catch(ClassNotFoundException){ + System.out.println("ClassNotFoundException"); + cnx.close(); + return 0; + } + + // récupération de l'id du pays entrée en ligne de commande + PreparedStatement pst = cnx.prepareStatement( + "SELECT idPays FROM DEV31TP01Q1_ListePays WHERE nomPays=?"); + pst.setString(1, pays); + ResultSet rs = pst.executeQuery(); + pst.close(); + int idPays = null; + if (rs.next()){ + idPays = rs; + } + rs.close(); + if (idPays == null){ + System.out.println("Pays inconnus"); + return 0; + } + + // récupération des score du pays + PreparedStatement pst = cnx.prepareStatement( + "SELECT * FROM DEV31TP01Q1_score WHERE idCompetiteurs=?"); + pst.setInt(1, idPays); + ResultSet rs = pst.executeQuery(); + while (rs.next()){ + System.out.println(rs); + } + rs.close(); + pst.close(); + + } + catch(SQLException){ + System.out.println("SQLException"); + cnx.close(); + } + } +} diff --git a/DEV/DEV3.1/TP02_Transitions/Image.java~ b/DEV/DEV3.1/TP02_Transitions/Image.java~ new file mode 100644 index 0000000..e69de29 diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000000.png b/DEV/DEV3.1/TP02_Transitions/Images/0000000.png new file mode 100644 index 0000000..51c008c Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000100.png b/DEV/DEV3.1/TP02_Transitions/Images/0000100.png new file mode 100644 index 0000000..6f6f474 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000200.png b/DEV/DEV3.1/TP02_Transitions/Images/0000200.png new file mode 100644 index 0000000..138d69c Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000300.png b/DEV/DEV3.1/TP02_Transitions/Images/0000300.png new file mode 100644 index 0000000..4da258b Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000400.png b/DEV/DEV3.1/TP02_Transitions/Images/0000400.png new file mode 100644 index 0000000..b1f0c7f Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000500.png b/DEV/DEV3.1/TP02_Transitions/Images/0000500.png new file mode 100644 index 0000000..cafeeeb Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000600.png b/DEV/DEV3.1/TP02_Transitions/Images/0000600.png new file mode 100644 index 0000000..e7a4dc5 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000700.png b/DEV/DEV3.1/TP02_Transitions/Images/0000700.png new file mode 100644 index 0000000..8863d96 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000800.png b/DEV/DEV3.1/TP02_Transitions/Images/0000800.png new file mode 100644 index 0000000..a8f3441 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0000900.png b/DEV/DEV3.1/TP02_Transitions/Images/0000900.png new file mode 100644 index 0000000..876b62b Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0000900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001000.png b/DEV/DEV3.1/TP02_Transitions/Images/0001000.png new file mode 100644 index 0000000..c75b614 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001100.png b/DEV/DEV3.1/TP02_Transitions/Images/0001100.png new file mode 100644 index 0000000..222b21b Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001200.png b/DEV/DEV3.1/TP02_Transitions/Images/0001200.png new file mode 100644 index 0000000..8e8e247 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001300.png b/DEV/DEV3.1/TP02_Transitions/Images/0001300.png new file mode 100644 index 0000000..c7f8fad Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001400.png b/DEV/DEV3.1/TP02_Transitions/Images/0001400.png new file mode 100644 index 0000000..e60d507 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001500.png b/DEV/DEV3.1/TP02_Transitions/Images/0001500.png new file mode 100644 index 0000000..309cce1 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001600.png b/DEV/DEV3.1/TP02_Transitions/Images/0001600.png new file mode 100644 index 0000000..7fec025 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001700.png b/DEV/DEV3.1/TP02_Transitions/Images/0001700.png new file mode 100644 index 0000000..018002f Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001800.png b/DEV/DEV3.1/TP02_Transitions/Images/0001800.png new file mode 100644 index 0000000..27503b9 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0001900.png b/DEV/DEV3.1/TP02_Transitions/Images/0001900.png new file mode 100644 index 0000000..9843f82 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0001900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002000.png b/DEV/DEV3.1/TP02_Transitions/Images/0002000.png new file mode 100644 index 0000000..dda7843 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002100.png b/DEV/DEV3.1/TP02_Transitions/Images/0002100.png new file mode 100644 index 0000000..975f513 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002200.png b/DEV/DEV3.1/TP02_Transitions/Images/0002200.png new file mode 100644 index 0000000..e9d46c9 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002300.png b/DEV/DEV3.1/TP02_Transitions/Images/0002300.png new file mode 100644 index 0000000..27b6009 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002400.png b/DEV/DEV3.1/TP02_Transitions/Images/0002400.png new file mode 100644 index 0000000..0330d70 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002500.png b/DEV/DEV3.1/TP02_Transitions/Images/0002500.png new file mode 100644 index 0000000..6fd6d2e Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002600.png b/DEV/DEV3.1/TP02_Transitions/Images/0002600.png new file mode 100644 index 0000000..ee9fd89 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002700.png b/DEV/DEV3.1/TP02_Transitions/Images/0002700.png new file mode 100644 index 0000000..e84bbf3 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002800.png b/DEV/DEV3.1/TP02_Transitions/Images/0002800.png new file mode 100644 index 0000000..20e3e9f Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0002900.png b/DEV/DEV3.1/TP02_Transitions/Images/0002900.png new file mode 100644 index 0000000..4a4c86d Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0002900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003000.png b/DEV/DEV3.1/TP02_Transitions/Images/0003000.png new file mode 100644 index 0000000..f8863fc Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003100.png b/DEV/DEV3.1/TP02_Transitions/Images/0003100.png new file mode 100644 index 0000000..7562efd Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003200.png b/DEV/DEV3.1/TP02_Transitions/Images/0003200.png new file mode 100644 index 0000000..f635804 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003300.png b/DEV/DEV3.1/TP02_Transitions/Images/0003300.png new file mode 100644 index 0000000..2ee8421 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003400.png b/DEV/DEV3.1/TP02_Transitions/Images/0003400.png new file mode 100644 index 0000000..314c332 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003500.png b/DEV/DEV3.1/TP02_Transitions/Images/0003500.png new file mode 100644 index 0000000..28f9cd6 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003600.png b/DEV/DEV3.1/TP02_Transitions/Images/0003600.png new file mode 100644 index 0000000..5b9b20f Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003700.png b/DEV/DEV3.1/TP02_Transitions/Images/0003700.png new file mode 100644 index 0000000..d1af990 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003800.png b/DEV/DEV3.1/TP02_Transitions/Images/0003800.png new file mode 100644 index 0000000..4cf2721 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0003900.png b/DEV/DEV3.1/TP02_Transitions/Images/0003900.png new file mode 100644 index 0000000..22609de Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0003900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004000.png b/DEV/DEV3.1/TP02_Transitions/Images/0004000.png new file mode 100644 index 0000000..b025930 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004100.png b/DEV/DEV3.1/TP02_Transitions/Images/0004100.png new file mode 100644 index 0000000..4cbe595 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004200.png b/DEV/DEV3.1/TP02_Transitions/Images/0004200.png new file mode 100644 index 0000000..6a4abbc Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004300.png b/DEV/DEV3.1/TP02_Transitions/Images/0004300.png new file mode 100644 index 0000000..d008dc3 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004400.png b/DEV/DEV3.1/TP02_Transitions/Images/0004400.png new file mode 100644 index 0000000..a67ce6f Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004500.png b/DEV/DEV3.1/TP02_Transitions/Images/0004500.png new file mode 100644 index 0000000..4fff54a Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004600.png b/DEV/DEV3.1/TP02_Transitions/Images/0004600.png new file mode 100644 index 0000000..91d1ac4 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004700.png b/DEV/DEV3.1/TP02_Transitions/Images/0004700.png new file mode 100644 index 0000000..e82378c Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004800.png b/DEV/DEV3.1/TP02_Transitions/Images/0004800.png new file mode 100644 index 0000000..2910a33 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0004900.png b/DEV/DEV3.1/TP02_Transitions/Images/0004900.png new file mode 100644 index 0000000..5088109 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0004900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005000.png b/DEV/DEV3.1/TP02_Transitions/Images/0005000.png new file mode 100644 index 0000000..73ffad1 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005100.png b/DEV/DEV3.1/TP02_Transitions/Images/0005100.png new file mode 100644 index 0000000..b903efe Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005200.png b/DEV/DEV3.1/TP02_Transitions/Images/0005200.png new file mode 100644 index 0000000..51a77d0 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005300.png b/DEV/DEV3.1/TP02_Transitions/Images/0005300.png new file mode 100644 index 0000000..65717df Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005400.png b/DEV/DEV3.1/TP02_Transitions/Images/0005400.png new file mode 100644 index 0000000..8b82bde Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005500.png b/DEV/DEV3.1/TP02_Transitions/Images/0005500.png new file mode 100644 index 0000000..53e68d2 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005600.png b/DEV/DEV3.1/TP02_Transitions/Images/0005600.png new file mode 100644 index 0000000..830ef57 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005700.png b/DEV/DEV3.1/TP02_Transitions/Images/0005700.png new file mode 100644 index 0000000..fa19c6f Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005800.png b/DEV/DEV3.1/TP02_Transitions/Images/0005800.png new file mode 100644 index 0000000..1967a13 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0005900.png b/DEV/DEV3.1/TP02_Transitions/Images/0005900.png new file mode 100644 index 0000000..dc4d8c5 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0005900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006000.png b/DEV/DEV3.1/TP02_Transitions/Images/0006000.png new file mode 100644 index 0000000..a6e9161 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006100.png b/DEV/DEV3.1/TP02_Transitions/Images/0006100.png new file mode 100644 index 0000000..1538a1b Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006200.png b/DEV/DEV3.1/TP02_Transitions/Images/0006200.png new file mode 100644 index 0000000..b14b9ed Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006300.png b/DEV/DEV3.1/TP02_Transitions/Images/0006300.png new file mode 100644 index 0000000..f6c61fe Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006400.png b/DEV/DEV3.1/TP02_Transitions/Images/0006400.png new file mode 100644 index 0000000..6dd985d Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006500.png b/DEV/DEV3.1/TP02_Transitions/Images/0006500.png new file mode 100644 index 0000000..eb96f18 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006600.png b/DEV/DEV3.1/TP02_Transitions/Images/0006600.png new file mode 100644 index 0000000..c682714 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006700.png b/DEV/DEV3.1/TP02_Transitions/Images/0006700.png new file mode 100644 index 0000000..6499667 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006800.png b/DEV/DEV3.1/TP02_Transitions/Images/0006800.png new file mode 100644 index 0000000..0669bd3 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0006900.png b/DEV/DEV3.1/TP02_Transitions/Images/0006900.png new file mode 100644 index 0000000..3bfdd66 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0006900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007000.png b/DEV/DEV3.1/TP02_Transitions/Images/0007000.png new file mode 100644 index 0000000..6203e19 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007100.png b/DEV/DEV3.1/TP02_Transitions/Images/0007100.png new file mode 100644 index 0000000..ccacd8c Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007200.png b/DEV/DEV3.1/TP02_Transitions/Images/0007200.png new file mode 100644 index 0000000..92d30d8 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007300.png b/DEV/DEV3.1/TP02_Transitions/Images/0007300.png new file mode 100644 index 0000000..d774d2a Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007400.png b/DEV/DEV3.1/TP02_Transitions/Images/0007400.png new file mode 100644 index 0000000..be6347f Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007500.png b/DEV/DEV3.1/TP02_Transitions/Images/0007500.png new file mode 100644 index 0000000..0714820 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007600.png b/DEV/DEV3.1/TP02_Transitions/Images/0007600.png new file mode 100644 index 0000000..5c3da99 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007700.png b/DEV/DEV3.1/TP02_Transitions/Images/0007700.png new file mode 100644 index 0000000..723dec4 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007800.png b/DEV/DEV3.1/TP02_Transitions/Images/0007800.png new file mode 100644 index 0000000..ae7ff9f Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0007900.png b/DEV/DEV3.1/TP02_Transitions/Images/0007900.png new file mode 100644 index 0000000..2f1f5c9 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0007900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008000.png b/DEV/DEV3.1/TP02_Transitions/Images/0008000.png new file mode 100644 index 0000000..1e9c415 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008100.png b/DEV/DEV3.1/TP02_Transitions/Images/0008100.png new file mode 100644 index 0000000..223f016 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008200.png b/DEV/DEV3.1/TP02_Transitions/Images/0008200.png new file mode 100644 index 0000000..dede494 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008300.png b/DEV/DEV3.1/TP02_Transitions/Images/0008300.png new file mode 100644 index 0000000..799917c Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008400.png b/DEV/DEV3.1/TP02_Transitions/Images/0008400.png new file mode 100644 index 0000000..6c3130d Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008500.png b/DEV/DEV3.1/TP02_Transitions/Images/0008500.png new file mode 100644 index 0000000..2b57d51 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008600.png b/DEV/DEV3.1/TP02_Transitions/Images/0008600.png new file mode 100644 index 0000000..787acd7 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008700.png b/DEV/DEV3.1/TP02_Transitions/Images/0008700.png new file mode 100644 index 0000000..334b6b4 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008800.png b/DEV/DEV3.1/TP02_Transitions/Images/0008800.png new file mode 100644 index 0000000..274bb72 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0008900.png b/DEV/DEV3.1/TP02_Transitions/Images/0008900.png new file mode 100644 index 0000000..961758e Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0008900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009000.png b/DEV/DEV3.1/TP02_Transitions/Images/0009000.png new file mode 100644 index 0000000..2c5775b Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009000.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009100.png b/DEV/DEV3.1/TP02_Transitions/Images/0009100.png new file mode 100644 index 0000000..fc838d9 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009100.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009200.png b/DEV/DEV3.1/TP02_Transitions/Images/0009200.png new file mode 100644 index 0000000..d5c9cf6 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009200.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009300.png b/DEV/DEV3.1/TP02_Transitions/Images/0009300.png new file mode 100644 index 0000000..44160b0 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009300.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009400.png b/DEV/DEV3.1/TP02_Transitions/Images/0009400.png new file mode 100644 index 0000000..72b11f1 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009400.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009500.png b/DEV/DEV3.1/TP02_Transitions/Images/0009500.png new file mode 100644 index 0000000..429a5f8 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009500.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009600.png b/DEV/DEV3.1/TP02_Transitions/Images/0009600.png new file mode 100644 index 0000000..46f8e07 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009600.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009700.png b/DEV/DEV3.1/TP02_Transitions/Images/0009700.png new file mode 100644 index 0000000..2a4253b Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009700.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009800.png b/DEV/DEV3.1/TP02_Transitions/Images/0009800.png new file mode 100644 index 0000000..dfcefd9 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009800.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Images/0009900.png b/DEV/DEV3.1/TP02_Transitions/Images/0009900.png new file mode 100644 index 0000000..f221452 Binary files /dev/null and b/DEV/DEV3.1/TP02_Transitions/Images/0009900.png differ diff --git a/DEV/DEV3.1/TP02_Transitions/Model.java~ b/DEV/DEV3.1/TP02_Transitions/Model.java~ new file mode 100644 index 0000000..e69de29 diff --git a/DEV/DEV3.1/TP02_Transitions/Q1Evenement.java b/DEV/DEV3.1/TP02_Transitions/Q1Evenement.java new file mode 100644 index 0000000..0db6b0a --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q1Evenement.java @@ -0,0 +1,40 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q1Evenement implements MouseListener{ + public String chemin; + public JLabel image; + public JFrame fenetre; + + public Q1Evenement(JFrame fenetre, String chemin){ + this.chemin = chemin; + this.image = new JLabel(new ImageIcon(this.chemin)); + this.fenetre = fenetre; + this.fenetre.add(this.image, BorderLayout.CENTER); + } + + @Override + public void mouseClicked(MouseEvent e){ + int largeurImage = fenetre.getWidth(); + int clicX = e.getX(); + this.fenetre.remove(this.image); + if (clicX < largeurImage/2){ + this.chemin = Q1Model.previous(this.chemin); + } + else{ + this.chemin = Q1Model.next(this.chemin); + } + this.image = new JLabel(new ImageIcon(this.chemin)); + this.fenetre.add(this.image, BorderLayout.CENTER); + this.fenetre.revalidate(); + } + @Override + public void mouseEntered(MouseEvent evenement){} + @Override + public void mouseExited(MouseEvent evenement){} + @Override + public void mousePressed(MouseEvent evenement){} + @Override + public void mouseReleased(MouseEvent evenement){} +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP02_Transitions/Q1Main.java b/DEV/DEV3.1/TP02_Transitions/Q1Main.java new file mode 100644 index 0000000..380bdcf --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q1Main.java @@ -0,0 +1,19 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q1Main{ + public static void main(String[] args) { + + JFrame fenetre = new JFrame("Q1 Galerie"); + fenetre.setSize(300, 200); + fenetre.setLocation(700, 300); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + + Q1Evenement evenementBouton = new Q1Evenement(fenetre, "Images/0000000.png"); + fenetre.addMouseListener(evenementBouton); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP02_Transitions/Q1Model.java b/DEV/DEV3.1/TP02_Transitions/Q1Model.java new file mode 100644 index 0000000..84daea2 --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q1Model.java @@ -0,0 +1,39 @@ +public class Q1Model{ + public final static int NBIMAGE = 10000; + public final static int PAS = 100; + public final static int NBCHIFFREIMAGE = 7; + public final static String CHEMIN = "Images/"; + + public static String next(String nomImage) { + int numImage; + try { + numImage = Integer.parseInt(nomImage.substring(Q1Model.CHEMIN.length(), Q1Model.CHEMIN.length() + Q1Model.NBCHIFFREIMAGE)); + numImage = (numImage+Q1Model.PAS)%Q1Model.NBIMAGE; + return Q1Model.CHEMIN + Q1Model.add0(numImage) + ".png"; + } + catch (NumberFormatException e) { + return null; + } + } + public static String previous(String nomImage) { + int numImage; + try { + numImage = Integer.parseInt(nomImage.substring(Q1Model.CHEMIN.length(), Q1Model.CHEMIN.length() + Q1Model.NBCHIFFREIMAGE)); + numImage = (numImage+Q1Model.NBIMAGE-Q1Model.PAS)%Q1Model.NBIMAGE; + return Q1Model.CHEMIN +Q1Model.add0(numImage) + ".png"; + } + catch (NumberFormatException e) { + return null; + } + } + + public static String add0(int number){ + int zeroAAjouter = Q1Model.NBCHIFFREIMAGE - Integer.toString(number).length(); + String resultat = ""; + for (int i=0; i < zeroAAjouter; i++){ + resultat += "0"; + } + resultat += Integer.toString(number); + return resultat; + } +} diff --git a/DEV/DEV3.1/TP02_Transitions/Q2Bouton.java b/DEV/DEV3.1/TP02_Transitions/Q2Bouton.java new file mode 100644 index 0000000..c81bb1c --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q2Bouton.java @@ -0,0 +1,21 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q2Bouton implements ActionListener{ + JDialog popup; + JFrame fenetre; + + public Q2Bouton(JDialog popup, JFrame fenetre){ + this.popup = popup; + this.fenetre = fenetre; + } + + @Override + public void actionPerformed(ActionEvent e){ + popup.dispose(); + if (fenetre != null){ + fenetre.dispose(); + } + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP02_Transitions/Q2ClosingEvent.java b/DEV/DEV3.1/TP02_Transitions/Q2ClosingEvent.java new file mode 100644 index 0000000..fc07082 --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q2ClosingEvent.java @@ -0,0 +1,30 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q2ClosingEvent implements WindowListener{ + public JFrame fenetre; + + public Q2ClosingEvent(JFrame fenetre){ + this.fenetre = fenetre; + } + + @Override + public void windowActivated(WindowEvent e){} + @Override + public void windowClosed(WindowEvent e){ + } + @Override + public void windowClosing(WindowEvent e){ + this.fenetre.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + JDialog newPopup = Q2PopUp.createPopup(this.fenetre); + } + @Override + public void windowDeactivated(WindowEvent e){} + @Override + public void windowDeiconified(WindowEvent e){} + @Override + public void windowIconified(WindowEvent e){} + @Override + public void windowOpened(WindowEvent e){} +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP02_Transitions/Q2Evenement.java b/DEV/DEV3.1/TP02_Transitions/Q2Evenement.java new file mode 100644 index 0000000..c50dbf5 --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q2Evenement.java @@ -0,0 +1,51 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q2Evenement implements MouseListener{ + public JFrame fenetre; + public JPanel listeImage; + public CardLayout listeOnglets; + public Container conteneur; + public int numImage; + + public Q2Evenement(JFrame fenetre){ + this.numImage = 1; + this.fenetre = fenetre; + this.conteneur = this.fenetre.getContentPane(); + this.listeOnglets = new CardLayout(); + this.listeImage = new JPanel(this.listeOnglets); + for (int i=0; i<(Q2Model.NBIMAGE/Q2Model.PAS); i++){ + String chemin = Q2Model.getChemin(i); + this.listeImage.add(new JLabel(new ImageIcon(chemin))); + } + this.fenetre.add(this.listeImage, BorderLayout.CENTER); + } + + @Override + public void mouseClicked(MouseEvent e){ + int largeurImage = fenetre.getWidth(); + int clicX = e.getX(); + if (clicX < largeurImage/2){ + if (this.numImage > 1){ + this.listeOnglets.previous(this.listeImage); + this.numImage --; + } + } + else{ + if (this.numImage < (Q2Model.NBIMAGE/Q2Model.PAS)){ + this.listeOnglets.next(this.listeImage); + this.numImage ++; + } + } + this.fenetre.revalidate(); + } + @Override + public void mouseEntered(MouseEvent evenement){} + @Override + public void mouseExited(MouseEvent evenement){} + @Override + public void mousePressed(MouseEvent evenement){} + @Override + public void mouseReleased(MouseEvent evenement){} +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP02_Transitions/Q2Main.java b/DEV/DEV3.1/TP02_Transitions/Q2Main.java new file mode 100644 index 0000000..2ebafca --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q2Main.java @@ -0,0 +1,18 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q2Main{ + public static void main(String[] args) { + + JFrame fenetre = new JFrame("Q2 Galerie"); + fenetre.setSize(300, 200); + fenetre.setLocation(700, 300); + + + Q2Evenement evenementBouton = new Q2Evenement(fenetre); + fenetre.addMouseListener(evenementBouton); + fenetre.addWindowListener(new Q2ClosingEvent(fenetre)); + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP02_Transitions/Q2Model.java b/DEV/DEV3.1/TP02_Transitions/Q2Model.java new file mode 100644 index 0000000..cf17f70 --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q2Model.java @@ -0,0 +1,21 @@ +public class Q2Model{ + public final static int NBIMAGE = 10000; + public final static int PAS = 100; + public final static int NBCHIFFREIMAGE = 7; + public final static String CHEMIN = "Images/"; + + public static String getChemin(int numImage) { + numImage = numImage*Q2Model.PAS; + return Q2Model.CHEMIN +Q2Model.add0(numImage) + ".png"; + } + + public static String add0(int number){ + int zeroAAjouter = Q2Model.NBCHIFFREIMAGE - Integer.toString(number).length(); + String resultat = ""; + for (int i=0; i < zeroAAjouter; i++){ + resultat += "0"; + } + resultat += Integer.toString(number); + return resultat; + } +} diff --git a/DEV/DEV3.1/TP02_Transitions/Q2PopUp.java b/DEV/DEV3.1/TP02_Transitions/Q2PopUp.java new file mode 100644 index 0000000..1e82d3f --- /dev/null +++ b/DEV/DEV3.1/TP02_Transitions/Q2PopUp.java @@ -0,0 +1,35 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q2PopUp{ + public static JDialog createPopup(JFrame fenetre) { + JDialog popup = new JDialog(fenetre); + popup.setTitle("^_^"); + popup.setSize(500, 300); + popup.setLocation((int)(100+(Math.random()*800)), (int)(100+(Math.random()*500))); + + JLabel message = new JLabel("Veux tu vraiment fermer la meilleur appli de tout l'univers ?",JLabel.CENTER); + JButton oui = new JButton("Oui (stp clic pas)"); + JButton non = new JButton("SURTOUT PAS !!!"); + + Q2Bouton nePasFermer = new Q2Bouton(popup, null); + Q2Bouton fermer = new Q2Bouton(popup, fenetre); + + oui.addActionListener(fermer); + non.addActionListener(nePasFermer); + + JPanel question = new JPanel(new FlowLayout(FlowLayout.CENTER)); + + message.setPreferredSize(new Dimension(10000,30)); + non.setPreferredSize(new Dimension(400,100)); + + question.add(message); + question.add(oui); + question.add(non); + + popup.add(question, BorderLayout.CENTER); + popup.setVisible(true); + return popup; + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP03_MisesEnPage/Q1ClosingEvent.class b/DEV/DEV3.1/TP03_MisesEnPage/Q1ClosingEvent.class new file mode 100644 index 0000000..f268966 Binary files /dev/null and b/DEV/DEV3.1/TP03_MisesEnPage/Q1ClosingEvent.class differ diff --git a/DEV/DEV3.1/TP03_MisesEnPage/Q1ClosingEvent.java b/DEV/DEV3.1/TP03_MisesEnPage/Q1ClosingEvent.java new file mode 100644 index 0000000..1423d3a --- /dev/null +++ b/DEV/DEV3.1/TP03_MisesEnPage/Q1ClosingEvent.java @@ -0,0 +1,34 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q1ClosingEvent implements WindowListener{ + public JFrame fenetre; + + public Q1ClosingEvent(JFrame fenetre){ + this.fenetre = fenetre; + } + + @Override + public void windowActivated(WindowEvent e){} + @Override + public void windowClosed(WindowEvent e){ + } + @Override + public void windowClosing(WindowEvent e){ + this.fenetre.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + int fermeture = JOptionPane.showConfirmDialog(this.fenetre, "Voulez vous vraiment fermer ?"); + if (fermeture == JOptionPane.YES_OPTION){ + this.fenetre.dispose(); + } + + } + @Override + public void windowDeactivated(WindowEvent e){} + @Override + public void windowDeiconified(WindowEvent e){} + @Override + public void windowIconified(WindowEvent e){} + @Override + public void windowOpened(WindowEvent e){} +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP03_MisesEnPage/Q1Main.class b/DEV/DEV3.1/TP03_MisesEnPage/Q1Main.class new file mode 100644 index 0000000..6f20e2d Binary files /dev/null and b/DEV/DEV3.1/TP03_MisesEnPage/Q1Main.class differ diff --git a/DEV/DEV3.1/TP03_MisesEnPage/Q1Main.java b/DEV/DEV3.1/TP03_MisesEnPage/Q1Main.java new file mode 100644 index 0000000..5e952d7 --- /dev/null +++ b/DEV/DEV3.1/TP03_MisesEnPage/Q1Main.java @@ -0,0 +1,92 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q1Main{ + public static void main(String[] args) { + + JFrame fenetre = new JFrame("Q1 Galerie"); + fenetre.setSize(300, 200); + fenetre.setLocation(700, 300); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + fenetre.setLayout(new GridBagLayout()); + + GridBagConstraints contrainte = new GridBagConstraints(); + + // Bouton 1 + + JButton bouton1 = new JButton("1"); + contrainte.gridx = 0; + contrainte.gridy = 0; + contrainte.gridwidth = 2; + contrainte.gridheight = 1; + contrainte.fill = GridBagConstraints.BOTH; + contrainte.anchor = GridBagConstraints.CENTER; + contrainte.weightx = 1.0; + contrainte.weighty = 1.0; + contrainte.insets = new Insets(0, 0, 0, 0); + fenetre.add(bouton1, contrainte); + + // Bouton 2 + + JButton bouton2 = new JButton("2"); + contrainte.gridx = 2; + contrainte.gridy = 0; + contrainte.gridwidth = 1; + contrainte.gridheight = 2; + contrainte.fill = GridBagConstraints.BOTH; + contrainte.anchor = GridBagConstraints.CENTER; + contrainte.weightx = 1.0; + contrainte.weighty = 1.0; + contrainte.insets = new Insets(0, 0, 0, 0); + fenetre.add(bouton2, contrainte); + + // Bouton 3 + + JButton bouton3 = new JButton("3"); + contrainte.gridx = 1; + contrainte.gridy = 2; + contrainte.gridwidth = 2; + contrainte.gridheight = 1; + contrainte.fill = GridBagConstraints.BOTH; + contrainte.anchor = GridBagConstraints.CENTER; + contrainte.weightx = 1.0; + contrainte.weighty = 1.0; + contrainte.insets = new Insets(0, 0, 0, 0); + fenetre.add(bouton3, contrainte); + + // Bouton 4 + + JButton bouton4 = new JButton("4"); + contrainte.gridx = 0; + contrainte.gridy = 1; + contrainte.gridwidth = 1; + contrainte.gridheight = 2; + contrainte.fill = GridBagConstraints.BOTH; + contrainte.anchor = GridBagConstraints.CENTER; + contrainte.weightx = 1.0; + contrainte.weighty = 1.0; + contrainte.insets = new Insets(0, 0, 0, 0); + fenetre.add(bouton4, contrainte); + + // Bouton 5 + + JButton bouton5 = new JButton("5"); + bouton5.setPreferredSize(new Dimension(50,50)); + contrainte.gridx = 1; + contrainte.gridy = 1; + contrainte.gridwidth = 1; + contrainte.gridheight = 1; + contrainte.fill = GridBagConstraints.BOTH; + contrainte.anchor = GridBagConstraints.CENTER; + contrainte.weightx = 0.0; + contrainte.weighty = 0.0; + contrainte.insets = new Insets(0, 0, 0, 0); + fenetre.add(bouton5, contrainte); + + Q1ClosingEvent fermetureEvent = new Q1ClosingEvent(fenetre); + fenetre.addWindowListener(fermetureEvent); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP03_MisesEnPage/Q2Array.java b/DEV/DEV3.1/TP03_MisesEnPage/Q2Array.java new file mode 100644 index 0000000..64c7ca4 --- /dev/null +++ b/DEV/DEV3.1/TP03_MisesEnPage/Q2Array.java @@ -0,0 +1,18 @@ +import java.util.ArrayList; +import java.util.List; + +public class Q2Array { + private List elements; + + public Q2Array() { + elements = new ArrayList<>(); + } + + public void add(T element) { + elements.add(element); + } + + public List getListe() { + return elements; + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP03_MisesEnPage/Q2GetBD.java b/DEV/DEV3.1/TP03_MisesEnPage/Q2GetBD.java new file mode 100644 index 0000000..4462ce4 --- /dev/null +++ b/DEV/DEV3.1/TP03_MisesEnPage/Q2GetBD.java @@ -0,0 +1,54 @@ +import org.mariadb.jdbc.*; +import java.sql.*; + +public class Q2GetBD{ + public static String[] getBD() { + try{ + + Connection cnx = DriverManager.getConnection( + "jdbc:mariadb://dwarves.iut-fbleau.fr/wamster", + "wamster","32201909"); + try { + Class.forName("org.mariadb.jdbc.Driver"); + } + catch(ClassNotFoundException e){ + cnx.close(); + return null; + } + + try { + Q2Array resultat = new Q2Array(); + PreparedStatement pstChamp = cnx.prepareStatement( + "SELECT * FROM DEV31TP02Q2_Champ"); + ResultSet rsChamp = pstChamp.executeQuery(); + while (rsChamp.next()){ + int idChamp = rsChamp.getInt("id"); + String nomChamp = rsChamp.getString("c0de"); + Q2Array listeModule = new Q2Array(); + listeModule.add(nomChamp); + PreparedStatement pstModule = cnx.prepareStatement( + "SELECT score FROM DEV31TP02Q2_Module WHERE id=?"); + pstModule.setInt(1, idChamp); + ResultSet rsModule = pstModule.executeQuery(); + pstModule.close(); + while (rsModule.next()){ + listeModule.add(rsModule.getInt("score")); + } + rsModule.close(); + resultat.add(listeModule.getListe()); + } + rsChamp.close(); + pstChamp.close(); + cnx.close(); + return new resultat.getListe(); + } + catch(SQLException e){ + cnx.close(); + return null; + } + } + catch(SQLException e){ + return null; + } + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP03_MisesEnPage/Q2Main.java b/DEV/DEV3.1/TP03_MisesEnPage/Q2Main.java new file mode 100644 index 0000000..b6a0be4 --- /dev/null +++ b/DEV/DEV3.1/TP03_MisesEnPage/Q2Main.java @@ -0,0 +1,16 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q2Main{ + public static void main(String[] args) { + + JFrame fenetre = new JFrame("Question 2"); + fenetre.setSize(300, 200); + fenetre.setLocation(700, 300); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + fenetre.setVisible(true); + String[] resultat = Q2GetBD.getBD(); + System.out.println(); + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/Q1Evenement.class b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/Q1Evenement.class new file mode 100644 index 0000000..efe0852 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/Q1Evenement.class differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Evenement.class b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Evenement.class new file mode 100644 index 0000000..c030849 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Evenement.class differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Main.class b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Main.class new file mode 100644 index 0000000..4a54cc0 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Main.class differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Model.class b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Model.class new file mode 100644 index 0000000..60db319 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/build/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Model.class differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000000.png new file mode 100644 index 0000000..51c008c Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000100.png new file mode 100644 index 0000000..6f6f474 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000200.png new file mode 100644 index 0000000..138d69c Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000300.png new file mode 100644 index 0000000..4da258b Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000400.png new file mode 100644 index 0000000..b1f0c7f Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000500.png new file mode 100644 index 0000000..cafeeeb Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000600.png new file mode 100644 index 0000000..e7a4dc5 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000700.png new file mode 100644 index 0000000..8863d96 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000800.png new file mode 100644 index 0000000..a8f3441 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000900.png new file mode 100644 index 0000000..876b62b Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0000900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001000.png new file mode 100644 index 0000000..c75b614 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001100.png new file mode 100644 index 0000000..222b21b Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001200.png new file mode 100644 index 0000000..8e8e247 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001300.png new file mode 100644 index 0000000..c7f8fad Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001400.png new file mode 100644 index 0000000..e60d507 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001500.png new file mode 100644 index 0000000..309cce1 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001600.png new file mode 100644 index 0000000..7fec025 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001700.png new file mode 100644 index 0000000..018002f Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001800.png new file mode 100644 index 0000000..27503b9 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001900.png new file mode 100644 index 0000000..9843f82 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0001900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002000.png new file mode 100644 index 0000000..dda7843 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002100.png new file mode 100644 index 0000000..975f513 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002200.png new file mode 100644 index 0000000..e9d46c9 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002300.png new file mode 100644 index 0000000..27b6009 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002400.png new file mode 100644 index 0000000..0330d70 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002500.png new file mode 100644 index 0000000..6fd6d2e Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002600.png new file mode 100644 index 0000000..ee9fd89 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002700.png new file mode 100644 index 0000000..e84bbf3 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002800.png new file mode 100644 index 0000000..20e3e9f Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002900.png new file mode 100644 index 0000000..4a4c86d Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0002900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003000.png new file mode 100644 index 0000000..f8863fc Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003100.png new file mode 100644 index 0000000..7562efd Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003200.png new file mode 100644 index 0000000..f635804 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003300.png new file mode 100644 index 0000000..2ee8421 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003400.png new file mode 100644 index 0000000..314c332 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003500.png new file mode 100644 index 0000000..28f9cd6 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003600.png new file mode 100644 index 0000000..5b9b20f Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003700.png new file mode 100644 index 0000000..d1af990 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003800.png new file mode 100644 index 0000000..4cf2721 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003900.png new file mode 100644 index 0000000..22609de Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0003900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004000.png new file mode 100644 index 0000000..b025930 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004100.png new file mode 100644 index 0000000..4cbe595 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004200.png new file mode 100644 index 0000000..6a4abbc Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004300.png new file mode 100644 index 0000000..d008dc3 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004400.png new file mode 100644 index 0000000..a67ce6f Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004500.png new file mode 100644 index 0000000..4fff54a Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004600.png new file mode 100644 index 0000000..91d1ac4 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004700.png new file mode 100644 index 0000000..e82378c Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004800.png new file mode 100644 index 0000000..2910a33 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004900.png new file mode 100644 index 0000000..5088109 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0004900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005000.png new file mode 100644 index 0000000..73ffad1 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005100.png new file mode 100644 index 0000000..b903efe Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005200.png new file mode 100644 index 0000000..51a77d0 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005300.png new file mode 100644 index 0000000..65717df Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005400.png new file mode 100644 index 0000000..8b82bde Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005500.png new file mode 100644 index 0000000..53e68d2 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005600.png new file mode 100644 index 0000000..830ef57 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005700.png new file mode 100644 index 0000000..fa19c6f Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005800.png new file mode 100644 index 0000000..1967a13 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005900.png new file mode 100644 index 0000000..dc4d8c5 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0005900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006000.png new file mode 100644 index 0000000..a6e9161 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006100.png new file mode 100644 index 0000000..1538a1b Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006200.png new file mode 100644 index 0000000..b14b9ed Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006300.png new file mode 100644 index 0000000..f6c61fe Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006400.png new file mode 100644 index 0000000..6dd985d Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006500.png new file mode 100644 index 0000000..eb96f18 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006600.png new file mode 100644 index 0000000..c682714 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006700.png new file mode 100644 index 0000000..6499667 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006800.png new file mode 100644 index 0000000..0669bd3 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006900.png new file mode 100644 index 0000000..3bfdd66 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0006900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007000.png new file mode 100644 index 0000000..6203e19 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007100.png new file mode 100644 index 0000000..ccacd8c Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007200.png new file mode 100644 index 0000000..92d30d8 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007300.png new file mode 100644 index 0000000..d774d2a Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007400.png new file mode 100644 index 0000000..be6347f Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007500.png new file mode 100644 index 0000000..0714820 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007600.png new file mode 100644 index 0000000..5c3da99 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007700.png new file mode 100644 index 0000000..723dec4 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007800.png new file mode 100644 index 0000000..ae7ff9f Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007900.png new file mode 100644 index 0000000..2f1f5c9 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0007900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008000.png new file mode 100644 index 0000000..1e9c415 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008100.png new file mode 100644 index 0000000..223f016 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008200.png new file mode 100644 index 0000000..dede494 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008300.png new file mode 100644 index 0000000..799917c Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008400.png new file mode 100644 index 0000000..6c3130d Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008500.png new file mode 100644 index 0000000..2b57d51 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008600.png new file mode 100644 index 0000000..787acd7 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008700.png new file mode 100644 index 0000000..334b6b4 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008800.png new file mode 100644 index 0000000..274bb72 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008900.png new file mode 100644 index 0000000..961758e Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0008900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009000.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009000.png new file mode 100644 index 0000000..2c5775b Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009000.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009100.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009100.png new file mode 100644 index 0000000..fc838d9 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009100.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009200.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009200.png new file mode 100644 index 0000000..d5c9cf6 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009200.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009300.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009300.png new file mode 100644 index 0000000..44160b0 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009300.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009400.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009400.png new file mode 100644 index 0000000..72b11f1 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009400.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009500.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009500.png new file mode 100644 index 0000000..429a5f8 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009500.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009600.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009600.png new file mode 100644 index 0000000..46f8e07 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009600.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009700.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009700.png new file mode 100644 index 0000000..2a4253b Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009700.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009800.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009800.png new file mode 100644 index 0000000..dfcefd9 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009800.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009900.png b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009900.png new file mode 100644 index 0000000..f221452 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/res/0009900.png differ diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Evenement.java b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Evenement.java new file mode 100644 index 0000000..228301d --- /dev/null +++ b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Evenement.java @@ -0,0 +1,46 @@ +package fr.iutfbleau.wamster.dev31.tp4.q1; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; +import java.net.*; + +public class Q1Evenement implements MouseListener{ + public URL chemin; + public JLabel image; + public JFrame fenetre; + public Q1Model listeImg; + + public Q1Evenement(JFrame fenetre){ + this.listeImg = new Q1Model(); + this.chemin = this.listeImg.current(); + this.image = new JLabel(new ImageIcon(this.chemin)); + this.fenetre = fenetre; + this.fenetre.add(this.image, BorderLayout.CENTER); + } + + @Override + public void mouseClicked(MouseEvent e){ + int largeurImage = fenetre.getWidth(); + int clicX = e.getX(); + this.fenetre.remove(this.image); + if (clicX < largeurImage/2){ + this.chemin = this.listeImg.previous(); + } + else{ + this.chemin = this.listeImg.next(); + } + System.out.println(this.chemin); + this.image = new JLabel(new ImageIcon(this.chemin)); + this.fenetre.add(this.image, BorderLayout.CENTER); + this.fenetre.revalidate(); + } + @Override + public void mouseEntered(MouseEvent evenement){} + @Override + public void mouseExited(MouseEvent evenement){} + @Override + public void mousePressed(MouseEvent evenement){} + @Override + public void mouseReleased(MouseEvent evenement){} +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Main.java b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Main.java new file mode 100644 index 0000000..af6e1e6 --- /dev/null +++ b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Main.java @@ -0,0 +1,21 @@ +package fr.iutfbleau.wamster.dev31.tp4.q1; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q1Main{ + public static void main(String[] args) { + + JFrame fenetre = new JFrame("Q1 Galerie"); + fenetre.setSize(300, 200); + fenetre.setLocation(700, 300); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + + Q1Evenement evenementBouton = new Q1Evenement(fenetre); + fenetre.addMouseListener(evenementBouton); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Model.java b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Model.java new file mode 100644 index 0000000..060ef73 --- /dev/null +++ b/DEV/DEV3.1/TP04_OrganisationDuCode/Q1/src/fr/iutfbleau/wamster/dev31/tp4/q1/Q1Model.java @@ -0,0 +1,51 @@ +package fr.iutfbleau.wamster.dev31.tp4.q1; + +import java.net.*; + +public class Q1Model{ + public static final String CHEMIN = "res/"; + public static final ClassLoader LOADER = Thread.currentThread().getContextClassLoader(); + public static final String EXTENSION = ".png"; + public int numImg; + public final URL [] TabImg; + + public Q1Model(){ + this.numImg = 0; + int numImage,i; + this.TabImg = new URL[100]; + for (numImage=0, i=0; i<10000; i+=100, numImage++){ + this.TabImg[numImage] = this.LOADER.getResource(this.CHEMIN + Q1Model.add0(i)+ this.EXTENSION); + } + } + + + public URL next() { + this.numImg++; + if (this.numImg >= this.TabImg.length){ + this.numImg = 0; + } + return this.TabImg[this.numImg]; + + } + public URL previous() { + this.numImg--; + if (this.numImg < 0){ + this.numImg = this.TabImg.length -1; + } + return this.TabImg[this.numImg]; + } + + public URL current() { + return this.TabImg[this.numImg]; + } + + public static String add0(int number){ + int zeroAAjouter = 7 - Integer.toString(number).length(); + String resultat = ""; + for (int i=0; i < zeroAAjouter; i++){ + resultat += "0"; + } + resultat += Integer.toString(number); + return resultat; + } +} diff --git a/DEV/DEV3.1/TP04_OrganisationDuCode/q1.jar b/DEV/DEV3.1/TP04_OrganisationDuCode/q1.jar new file mode 100644 index 0000000..7ef2793 Binary files /dev/null and b/DEV/DEV3.1/TP04_OrganisationDuCode/q1.jar differ diff --git a/DEV/DEV3.2/TP01_Genericite/Q1Main.class b/DEV/DEV3.2/TP01_Genericite/Q1Main.class new file mode 100644 index 0000000..d7a2994 Binary files /dev/null and b/DEV/DEV3.2/TP01_Genericite/Q1Main.class differ diff --git a/DEV/DEV3.2/TP01_Genericite/Q1Main.java b/DEV/DEV3.2/TP01_Genericite/Q1Main.java new file mode 100644 index 0000000..e7f5bd2 --- /dev/null +++ b/DEV/DEV3.2/TP01_Genericite/Q1Main.java @@ -0,0 +1,44 @@ +import java.util.*; + +public class Q1Main{ + public static void main(String[] args) { + ArrayList listeInt = new ArrayList (); + ArrayList listeFloat = new ArrayList (); + ArrayList listeNb = new ArrayList (); + Integer nbInt = 6; + Float nbFloat = 6f; + Long nLong = 6l; + + listeInt.add(nbInt); + listeFloat.add(nbFloat); + listeNb.add(nLong); + + listeInt.add(nbInt); + listeFloat.add(nbFloat); + listeNb.add(nLong); + + listeInt.add(nbInt); + listeFloat.add(nbFloat); + listeNb.add(nLong); + + System.out.println(listeInt); + System.out.println(listeFloat); + System.out.println(listeNb); + System.out.println(); + + // petit b + + //listeInt.addAll(listeFloat); Ne fonctionne pas + //listeInt.addAll(listeNb); Ne fonctionne pas + + //listeFloat.addAll(listeInt); Ne fonctionne pas + //listeFloat.addAll(listeNb); Ne fonctionne pas + + listeNb.addAll(listeInt); + listeNb.addAll(listeFloat); + + System.out.println(listeInt); + System.out.println(listeFloat); + System.out.println(listeNb); + } +} diff --git a/DEV/DEV3.2/TP01_Genericite/Q2Main.class b/DEV/DEV3.2/TP01_Genericite/Q2Main.class new file mode 100644 index 0000000..fca755e Binary files /dev/null and b/DEV/DEV3.2/TP01_Genericite/Q2Main.class differ diff --git a/DEV/DEV3.2/TP01_Genericite/Q2Main.java b/DEV/DEV3.2/TP01_Genericite/Q2Main.java new file mode 100644 index 0000000..cdce0ca --- /dev/null +++ b/DEV/DEV3.2/TP01_Genericite/Q2Main.java @@ -0,0 +1,19 @@ +import java.util.*; +import java.text.*; + +public class Q2Main{ + public static void main(String[] args) { + System.out.println(Arrays.toString(args)); + + // b + String[] args5 = Arrays.copyOf(args, 5); + System.out.println(Arrays.toString(Arrays.copyOf(args, 5))); + + //c + Collator collator = Collator.getInstance(Locale.FRENCH); + collator.setStrength(Collator.PRIMARY); + Arrays.sort(args, collator); + System.out.println(Arrays.toString(args)); + + } +} diff --git a/DEV/DEV3.2/TP01_Genericite/Q3Frequence.class b/DEV/DEV3.2/TP01_Genericite/Q3Frequence.class new file mode 100644 index 0000000..4308416 Binary files /dev/null and b/DEV/DEV3.2/TP01_Genericite/Q3Frequence.class differ diff --git a/DEV/DEV3.2/TP01_Genericite/Q3Frequence.java b/DEV/DEV3.2/TP01_Genericite/Q3Frequence.java new file mode 100644 index 0000000..9e6e08f --- /dev/null +++ b/DEV/DEV3.2/TP01_Genericite/Q3Frequence.java @@ -0,0 +1,20 @@ +public class Q3Frequence{ + public static Q4Association getSouvent(T[] tableau) { + int occurenceMax = 0; + T elementMax=null; + for (T element1 : tableau){ + int occurence = 0; + for (T element2 : tableau){ + if (element1.equals(element2)){ + occurence ++; + } + } + if (occurenceMax < occurence){ + occurenceMax = occurence; + elementMax = element1; + } + } + return new Q4Association(elementMax, occurenceMax); + } +} + diff --git a/DEV/DEV3.2/TP01_Genericite/Q3Main.class b/DEV/DEV3.2/TP01_Genericite/Q3Main.class new file mode 100644 index 0000000..7a90e81 Binary files /dev/null and b/DEV/DEV3.2/TP01_Genericite/Q3Main.class differ diff --git a/DEV/DEV3.2/TP01_Genericite/Q3Main.java b/DEV/DEV3.2/TP01_Genericite/Q3Main.java new file mode 100644 index 0000000..a763fe9 --- /dev/null +++ b/DEV/DEV3.2/TP01_Genericite/Q3Main.java @@ -0,0 +1,8 @@ +public class Q3Main{ + public static void main(String[] args) { + Integer[] tableau1 = {7,5,3,6,9,5,5,4,6,5,5,9,5,4,7,54,5,5,4,7,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + String[] tableau2 = {"a","b","e","r","r","r","e","a","z","z"}; + System.out.println(Q3Frequence.getSouvent(tableau1).toString()); + System.out.println(Q3Frequence.getSouvent(tableau2).toString()); + } +} diff --git a/DEV/DEV3.2/TP01_Genericite/Q4Association.class b/DEV/DEV3.2/TP01_Genericite/Q4Association.class new file mode 100644 index 0000000..760f90f Binary files /dev/null and b/DEV/DEV3.2/TP01_Genericite/Q4Association.class differ diff --git a/DEV/DEV3.2/TP01_Genericite/Q4Association.java b/DEV/DEV3.2/TP01_Genericite/Q4Association.java new file mode 100644 index 0000000..89109c6 --- /dev/null +++ b/DEV/DEV3.2/TP01_Genericite/Q4Association.java @@ -0,0 +1,27 @@ +public class Q4Association { + private T element; + private int frequence; + //private ??????????????????????????????????????????????????????????? suivant; + + public Q4Association(T element, int frequence){ + this.element = element; + this.frequence =frequence; + } + public T getElement(){ + return this.element; + } + public void setElement(T element){ + this.element = element; + } + public int getFrequence(){ + return this.frequence; + } + public void setFrequence(int frequence){ + this.frequence = frequence; + } + @Override + public String toString(){ + return "element = " + this.getElement().toString() + " ; frequence = " + this.getFrequence(); + } +} + diff --git a/DEV/DEV3.2/TP01_Genericite/Q5Liste.java b/DEV/DEV3.2/TP01_Genericite/Q5Liste.java new file mode 100644 index 0000000..629e6da --- /dev/null +++ b/DEV/DEV3.2/TP01_Genericite/Q5Liste.java @@ -0,0 +1,26 @@ +public class Q5Liste { + private Q4Association[] liste; + + public Q5Liste(Q4Association[] liste){ + this.liste = liste; + } + + public void ajouter(T element){ + boolean flag = true; + for (int i=0; i < this.liste.length && flag == true; i++){ + if (element.equals(this.liste[i].getElement())){ + this.liste[i].setFrequence(this.liste[i].getFrequence()+1); + flag = false; + } + } + if (flag == true){ + // new Q4Association(element, 1); + } + } + + @Override + public String toString(){ + return ""; + } +} + diff --git a/DEV/DEV3.2/TP02_Recursivite/Q1Factoriel.class b/DEV/DEV3.2/TP02_Recursivite/Q1Factoriel.class new file mode 100644 index 0000000..da65549 Binary files /dev/null and b/DEV/DEV3.2/TP02_Recursivite/Q1Factoriel.class differ diff --git a/DEV/DEV3.2/TP02_Recursivite/Q1Factoriel.java b/DEV/DEV3.2/TP02_Recursivite/Q1Factoriel.java new file mode 100644 index 0000000..0dec8f2 --- /dev/null +++ b/DEV/DEV3.2/TP02_Recursivite/Q1Factoriel.java @@ -0,0 +1,32 @@ +import java.lang.*; + +public class Q1Factoriel{ + int tour; + public Q1Factoriel(){ + tour = -1; + } + public long factoriel(long n) { + this.tour ++; + this.espace(n); + if (n < 0){ + return -1; + } + if (n < 2){ + //Thread.dumpStack(); + this.espace(1); + this.tour --; + return 1; + } + long resultat = n*factoriel(n-1); + this.espace(resultat); + this.tour --; + return resultat; + } + + public void espace(long txt){ + for (int i=0; i=0 && i < this.tabString.length){ + this.tabInt[i] = Integer.parseInt(this.tabString[i]); + stringToInt(i+1); + } + } + public void printInt(int i) { + if (i>=0 && i < this.tabInt.length-1){ + System.out.print(this.tabInt[i] + " "); + printInt(i+1); + } + if (i == this.tabInt.length-1){ + System.out.println(this.tabInt[i]); + } + } + + public void printInv(int i) { + if (i>=0 && i < this.tabInt.length-1){ + System.out.print(this.tabInt[this.tabInt.length-i-1] + " "); + printInt(i+1); + } + if (i == this.tabInt.length-1){ + System.out.println(this.tabInt[0]); + } + } + + private void paire(int i) { + if (i==0){ + this.paire = 0; + } + if (i>=0 && i < this.tabInt.length){ + if (this.tabInt[i]%2 == 0){ + this.paire ++; + } + paire(i+1); + } + } + + private void max(int i) { + if (i==0){ + this.max = 0; + } + if (i>=0 && i < this.tabInt.length){ + if (this.tabInt[i] > this.max){ + this.max = this.tabInt[i]; + } + max(i+1); + } + } + + public int getPaire(){ + paire(0); + return this.paire; + } + + public int getMax(){ + max(0); + return this.max; + } +} \ No newline at end of file diff --git a/DEV/DEV3.2/TP02_Recursivite/Q3Fibonacci.class b/DEV/DEV3.2/TP02_Recursivite/Q3Fibonacci.class new file mode 100644 index 0000000..b339640 Binary files /dev/null and b/DEV/DEV3.2/TP02_Recursivite/Q3Fibonacci.class differ diff --git a/DEV/DEV3.2/TP02_Recursivite/Q3Fibonacci.java b/DEV/DEV3.2/TP02_Recursivite/Q3Fibonacci.java new file mode 100644 index 0000000..c33353d --- /dev/null +++ b/DEV/DEV3.2/TP02_Recursivite/Q3Fibonacci.java @@ -0,0 +1,36 @@ +import java.lang.*; + +public class Q3Fibonacci{ + int tour; + public Q3Fibonacci(){ + tour = -1; + } + public int fibonacci(int n) { + this.tour ++; + this.espace(n); + if (n < 0){ + return -1; + } + if (n == 0){ + this.espace(0); + this.tour --; + return 0; + } + if (n == 1){ + this.espace(1); + this.tour --; + return 1; + } + int resultat = fibonacci(n-2) + fibonacci(n-1); + this.espace(resultat); + this.tour --; + return resultat; + } + + private void espace(int txt){ + for (int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DEV/DEV_William/TP01_2.ods b/DEV/DEV_William/TP01_2.ods new file mode 100644 index 0000000..d2e65d5 Binary files /dev/null and b/DEV/DEV_William/TP01_2.ods differ diff --git a/EC/.~lock.LettreDeMotive1.docx# b/EC/.~lock.LettreDeMotive1.docx# new file mode 100644 index 0000000..408d43d --- /dev/null +++ b/EC/.~lock.LettreDeMotive1.docx# @@ -0,0 +1 @@ +,wamster,salle225-08,15.12.2022 14:01,file:///export/home/an22/wamster/.config/libreoffice/4; \ No newline at end of file diff --git a/EC/LettreDeMotivation.txt.txt b/EC/LettreDeMotivation.txt.txt new file mode 100644 index 0000000..0fc30c4 --- /dev/null +++ b/EC/LettreDeMotivation.txt.txt @@ -0,0 +1 @@ +Alexis WAMSTER diff --git a/EC/LettreDeMotivation~ b/EC/LettreDeMotivation~ new file mode 100644 index 0000000..e69de29 diff --git a/EC/LettreDeMotive1.docx b/EC/LettreDeMotive1.docx new file mode 100755 index 0000000..9792515 Binary files /dev/null and b/EC/LettreDeMotive1.docx differ diff --git a/EC/Projet Voltaire v7.2.97.0.pdf b/EC/Projet Voltaire v7.2.97.0.pdf new file mode 100644 index 0000000..8aa1551 Binary files /dev/null and b/EC/Projet Voltaire v7.2.97.0.pdf differ diff --git a/EC/test.docs b/EC/test.docs new file mode 100644 index 0000000..c202acd --- /dev/null +++ b/EC/test.docs @@ -0,0 +1,22 @@ +infowamsta +BUTinfo32201909 + +je peux +tu peux +il peut + +impératif +tu (sans s) +sautf -y -en + +je savais +tu savais +il savait + +Sauf « butée », « compotée », « députée », « dictée », « jetée », « montée », « nuitée », « pâtée », « portée », « potée », « remontée », « tétée », « tripotée », +ainsi que les noms exprimant un contenu (« assiettée », « brouettée », « pelletée », etc.). + +la nôtre + +cauchemar +endre / andre / ondre / erdre / ordre / oudre \ No newline at end of file diff --git a/EC/test.docs~ b/EC/test.docs~ new file mode 100644 index 0000000..a9536a9 --- /dev/null +++ b/EC/test.docs~ @@ -0,0 +1,2 @@ +infowamsta +BUTinfo32201909 \ No newline at end of file diff --git a/EC/~$ttreDeMotivation b/EC/~$ttreDeMotivation new file mode 100755 index 0000000..c297991 Binary files /dev/null and b/EC/~$ttreDeMotivation differ diff --git a/Math/TP01/reponse.txt b/Math/TP01/reponse.txt new file mode 100644 index 0000000..cfff0de --- /dev/null +++ b/Math/TP01/reponse.txt @@ -0,0 +1,53 @@ +; => permet de masquer la réponse + +-------------------------- +save "toto.sod" +export LIBGL_ALWAYS_SOFTWARE=1 +scilab +load ("toto.sod") +---------------------------- +Q2) +X=[3 1 5 3 2 7 0 1 0 3 2 4 4 0 3 3 2 5 3 1]; +M=tabul(X,"i") + +Q3) +tri les valeur par ordre croissant + +Q4) +f=M(:,2) +v= f/length(X) + +Q5) +n=M(:,1) + +Q6) +pour trouver les fréquences cumulées: +fcc = cumsum(v) +bar (n,fcc) + +Q7) +pour trouver le mode: +modeX = X(find(v == max(v))) + +Q8) +Pour calculer la moyenne, 3 possibilitées: +- mu = sum(n.*f) +- mu = mean(X) +- mu = sum(X)/length(X) + +Q9) +Pour trouver les quartiles: +Xtrie = gsort(X,'c','i') +quartile1 = Xtrie(length(X)/4) +quartile3 = Xtrie(3*length(X)/4) + +Q10) + + +-------------------------------------------------------------------------------- +TP02 +-------------------------------------------------------------------------------- + +Q1) + + diff --git a/Math/TP01/reponse.txt~ b/Math/TP01/reponse.txt~ new file mode 100644 index 0000000..b6fe59a --- /dev/null +++ b/Math/TP01/reponse.txt~ @@ -0,0 +1,49 @@ +; => permet de masquer la réponse + +-------------------------- +save "toto.sod" +export LIBGL_ALWAYS_SOFTWARE=1 +scilab +load ("toto.sod") +---------------------------- +Q2) +X=[3 1 5 3 2 7 0 1 0 3 2 4 4 0 3 3 2 5 3 1]; +M=tabul(X,"i") + +Q3) +tri les valeur par ordre croissant + +Q4) +f=M(:,2) +v= f/length(X) + +Q5) +n=M(:,1) + +Q6) +pour trouver les fréquences cumulées: +fcc = cumsum(v) +bar (n,fcc) + +Q7) +pour trouver le mode: +modeX = X(find(v == max(v))) + +Q8) +Pour calculer la moyenne, 3 possibilitées: +- mu = sum(n.*f) +- mu = mean(X) +- mu = sum(X)/length(X) + +Q9) +Pour trouver les quartiles: +Xtrie = gsort(X,'c','i') +quartile1 = Xtrie(length(X)/4) +quartile3 = Xtrie(3*length(X)/4) + +Q10) + + + + + diff --git a/Math/dichotomie.txt b/Math/dichotomie.txt new file mode 100644 index 0000000..fafa09c --- /dev/null +++ b/Math/dichotomie.txt @@ -0,0 +1,36 @@ +function [resultat] = memeSigne(a, b) + if ((a <= 0 && b <= 0) || (a >= 0 && b >= 0)) + resultat = %T; // Utilisez %T pour représenter "true" en Scilab + else + resultat = %F; // Utilisez %F pour représenter "false" en Scilab + end +endfunction + +function [x] = dichotomie(f, xa, xb, eps) + fraction = 2; + difference = xb - xa; + x = xa + difference / fraction; + y = f[1]*x^2 + f[2]*x + f[3]; + ya = f[1]*xa^2 + f[2]*xa + f[3]; + yb = f[1]*xb^2 + f[2]*xb + f[3]; + + while (y <= -eps || y >= eps) + fraction = fraction * 2; + + if (memeSigne(ya, y)) + if (memeSigne(yb, y)) + endfunction + xa = x; + x = x + difference / fraction; + else + xb = x; + x = x - difference / fraction; + end + + y = f[1]*x^2 + f[2]*x + f[3]; + ya = f[1]*xa^2 + f[2]*xa + f[3]; + end + + // Assigner la valeur de x en sortie de la fonction + x_out = x; +endfunction diff --git a/Math/dichotomie.txt~ b/Math/dichotomie.txt~ new file mode 100644 index 0000000..e69de29 diff --git a/Math/scilab_tp2.txt b/Math/scilab_tp2.txt new file mode 100644 index 0000000..caddbc1 --- /dev/null +++ b/Math/scilab_tp2.txt @@ -0,0 +1,19 @@ +function [x_out] = Heron(x0, n) + xn = x0; + for i = 1:n + xn = xn - (xn*xn-2) / 2*xn; + end + + x_out = xn; +end + +-------------------------------------------------- +function [x_out] = Heron(x0, n) + y= + xn = x0; + for i = 1:n + xn = xn - (xn*xn-2) / 2*xn; + end + + x_out = xn; +end diff --git a/Math/scilab_tp2.txt~ b/Math/scilab_tp2.txt~ new file mode 100644 index 0000000..e69de29 diff --git a/PHP/Ex21.php b/PHP/Ex21.php new file mode 100644 index 0000000..fff39b9 --- /dev/null +++ b/PHP/Ex21.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/PHP/Ex21.php~ b/PHP/Ex21.php~ new file mode 100644 index 0000000..e69de29 diff --git a/SCR/TP01/adresses_virtuelles.c b/SCR/TP01/adresses_virtuelles.c new file mode 100644 index 0000000..fe6c824 --- /dev/null +++ b/SCR/TP01/adresses_virtuelles.c @@ -0,0 +1,29 @@ +/* adresses virtuelles d'un processus */ + +#include +#include +#include +#include + +int t[1000] = {[0 ... 999] = 2}; + +int main(int argc, char * argv[]) +{ + int i=3; + static int j = 3; + char * m = (char*)malloc(1); + + printf("mon pid est %d\n\n",getpid()); + + /* ------- Affichage des adresses --------*/ + + printf("main\t=\t%p\n",main); + printf("&argc\t=\t%p\n",&argc); + printf("&i\t=\t%p\n",&i); + printf("&j\t=\t%p\n",&j); + printf("t\t=\t%p\n",t); + printf("m\t=\t%p\n",m); + + getchar(); +} + diff --git a/SCR/TP01/alignement.c b/SCR/TP01/alignement.c new file mode 100644 index 0000000..af17aeb --- /dev/null +++ b/SCR/TP01/alignement.c @@ -0,0 +1,55 @@ +/* alignement et objets */ + +struct exemple1 { + int x; + int y; + int z; + int w; +}; + +struct exemple2 { + char x; + char y; + char z; + char w; +}; + +struct exemple3 { + int x; + int y; + char z; + char w; +}; + +struct exemple4 { + int x; + char y; + int z; + char w; +}; + +union exemple5 { + int x; + char y; + int z; + char w; +}; + +int main() +{ + int a[4] = {1,2,3,4}; + char c[4] = {'a','b','c','d'}; + struct exemple1 ex1 = {1,2,3,4}; + struct exemple2 ex2 = {'a','b','c','d'}; + struct exemple3 ex3 = {1,2,'c','d'}; + struct exemple4 ex4 = {1,'c',2,'d'}; + union exemple5 ex5; + int x = 61; + char y = 62; + int z = 63; + char w = 64; + ex5.x=62;ex5.y=63;ex5.z=64;ex5.w=65; + + // appelez hexdump pour chaque variable +} + diff --git a/SCR/TP01/bss_data.c b/SCR/TP01/bss_data.c new file mode 100644 index 0000000..9f75767 --- /dev/null +++ b/SCR/TP01/bss_data.c @@ -0,0 +1,10 @@ +/* segment bss et data */ +#define N 1000 +//int t[N]; /* version 1 */ +int t[N]={1}; /* version 2 */ + +int main() +{ + return 0; +} + diff --git a/SCR/TP01/bss_data.c~ b/SCR/TP01/bss_data.c~ new file mode 100644 index 0000000..b34c3db --- /dev/null +++ b/SCR/TP01/bss_data.c~ @@ -0,0 +1,10 @@ +/* segment bss et data */ +#define N 1000 +int t[N]; /* version 1 */ +//int t[N]={1}; /* version 2 */ + +int main() +{ + return 0; +} + diff --git a/SCR/TP01/ex1bis/Makefile b/SCR/TP01/ex1bis/Makefile new file mode 100644 index 0000000..f6ddfde --- /dev/null +++ b/SCR/TP01/ex1bis/Makefile @@ -0,0 +1,17 @@ +CFLAGS := -Wall -g -O0 +SRC=buf.c heap.c huge.c mmap.c null.c stack.c + +DEPENDHELPERS=helpers.o + +BINARIES=$(SRC:%.c=%) + +%.o : %c + gcc -c $+ + +$(BINARIES): % : %.o $(DEPENDHELPERS) + gcc -o $@ $+ + +all : $(BINARIES) + +clean: + rm -f *.o $(BINARIES) diff --git a/SCR/TP01/ex1bis/buf b/SCR/TP01/ex1bis/buf new file mode 100755 index 0000000..147754d Binary files /dev/null and b/SCR/TP01/ex1bis/buf differ diff --git a/SCR/TP01/ex1bis/buf.c b/SCR/TP01/ex1bis/buf.c new file mode 100644 index 0000000..b6b1d0f --- /dev/null +++ b/SCR/TP01/ex1bis/buf.c @@ -0,0 +1,10 @@ +#include "helpers.h" + +static char buf1[8 MB] = {0}; +static char buf2[16 MB] = {0}; + +int main(int argc, char **argv) +{ + randomize(buf2, 16 MB); + return interlude(); +} diff --git a/SCR/TP01/ex1bis/buf.o b/SCR/TP01/ex1bis/buf.o new file mode 100644 index 0000000..0f4bd1c Binary files /dev/null and b/SCR/TP01/ex1bis/buf.o differ diff --git a/SCR/TP01/ex1bis/data/256k b/SCR/TP01/ex1bis/data/256k new file mode 100644 index 0000000..f3e3746 Binary files /dev/null and b/SCR/TP01/ex1bis/data/256k differ diff --git a/SCR/TP01/ex1bis/heap.c b/SCR/TP01/ex1bis/heap.c new file mode 100644 index 0000000..196ecb9 --- /dev/null +++ b/SCR/TP01/ex1bis/heap.c @@ -0,0 +1,8 @@ +#include "helpers.h" + +int main(int argc, char **argv) +{ + dirty(16 MB); + clean(32 MB); + return interlude(); +} diff --git a/SCR/TP01/ex1bis/helpers.c b/SCR/TP01/ex1bis/helpers.c new file mode 100644 index 0000000..1a2799f --- /dev/null +++ b/SCR/TP01/ex1bis/helpers.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include "helpers.h" + +#include + +void randomize(char *buf, size_t n) +{ + assert(buf); + memset(buf, rand() & 0xff, n); +} + +void clean(size_t b) +{ + for (; b > 0; b -= 1 KB) + calloc(1 KB, sizeof(char)); +} + +void dirty(size_t b) +{ + for (; b > 0; b -= 1 KB) + randomize(calloc(1 KB, sizeof(char)), 1 KB); +} + +int interlude(void) +{ + pid_t pid = getpid(); + printf("pid %i\n", (int)pid); + printf("------------------------------------------\n" + "go check /proc/%i/smaps; I'll wait...\n" + "press when you're done\n", pid); + fgetc(stdin); + return 0; +} diff --git a/SCR/TP01/ex1bis/helpers.h b/SCR/TP01/ex1bis/helpers.h new file mode 100644 index 0000000..d8a774a --- /dev/null +++ b/SCR/TP01/ex1bis/helpers.h @@ -0,0 +1,13 @@ +#ifndef _HELPERS_H +#define _HELPERS_H +#include + +#define KB * 1024 +#define MB * 1024 * 1024 + +void randomize(char *buf, size_t n); +void clean(size_t n); +void dirty(size_t n); +int interlude(void); + +#endif diff --git a/SCR/TP01/ex1bis/helpers.o b/SCR/TP01/ex1bis/helpers.o new file mode 100644 index 0000000..739f87d Binary files /dev/null and b/SCR/TP01/ex1bis/helpers.o differ diff --git a/SCR/TP01/ex1bis/huge.c b/SCR/TP01/ex1bis/huge.c new file mode 100644 index 0000000..046aea0 --- /dev/null +++ b/SCR/TP01/ex1bis/huge.c @@ -0,0 +1,12 @@ +#include "helpers.h" + +int main(int argc, char **argv) +{ + char *under = malloc(96 KB); + randomize(under, 96 KB); + + char *over = malloc(256 KB); + randomize(over, 256 KB); + + return interlude(); +} diff --git a/SCR/TP01/ex1bis/mmap.c b/SCR/TP01/ex1bis/mmap.c new file mode 100644 index 0000000..ac62144 --- /dev/null +++ b/SCR/TP01/ex1bis/mmap.c @@ -0,0 +1,38 @@ +#include "helpers.h" +#include +#include +#include + + +int main(int argc, char **argv) +{ + /* inert map (never modified) */ + char *inert = mmap(NULL, 16 KB, + PROT_READ|PROT_WRITE, + MAP_ANONYMOUS|MAP_PRIVATE, + -1, 0); + /* anonymous, private mmap */ + char *anon_priv = mmap(NULL, 32 KB, + PROT_READ|PROT_WRITE, + MAP_ANONYMOUS|MAP_PRIVATE, + -1, 0); + randomize(anon_priv, 32 KB); + + /* anonymous, shared map */ + char *anon_shared = mmap(NULL, 64 KB, + PROT_READ|PROT_WRITE, + MAP_ANONYMOUS|MAP_SHARED, + -1, 0); + randomize(anon_shared, 64 KB); + + /* private, file-backed map */ + int fd = open("data/256k", O_RDWR); + assert(fd >= 0); + char *file = mmap(NULL, 256 KB, + PROT_READ|PROT_WRITE, + MAP_PRIVATE, + fd, 0); + randomize(file, 128 KB); + + return interlude(); +} diff --git a/SCR/TP01/ex1bis/null.c b/SCR/TP01/ex1bis/null.c new file mode 100644 index 0000000..fbd46f7 --- /dev/null +++ b/SCR/TP01/ex1bis/null.c @@ -0,0 +1,6 @@ +#include "helpers.h" + +int main(int argc, char **argv) +{ + return interlude(); +} diff --git a/SCR/TP01/ex1bis/stack.c b/SCR/TP01/ex1bis/stack.c new file mode 100644 index 0000000..700eef1 --- /dev/null +++ b/SCR/TP01/ex1bis/stack.c @@ -0,0 +1,8 @@ +#include "helpers.h" + +int main (int argc, char **argv) +{ + char buf[28 KB] = {0}; + randomize(buf, 28 KB); + return interlude(); +} diff --git a/SCR/TP01/exe b/SCR/TP01/exe new file mode 100755 index 0000000..e67e806 Binary files /dev/null and b/SCR/TP01/exe differ diff --git a/SCR/TP01/ij_ji.c b/SCR/TP01/ij_ji.c new file mode 100644 index 0000000..aaec9d0 --- /dev/null +++ b/SCR/TP01/ij_ji.c @@ -0,0 +1,38 @@ +/* accès mémoire */ + +#include +#include +#include +#define N 8192 + +int t[N][N]; + +static inline double tstamp(void) +{ + struct timespec tv; + clock_gettime(CLOCK_REALTIME, &tv); + return tv.tv_sec + tv.tv_nsec * 1.0e-9; +} + +int main() +{ + int i,j; + double t1,t2; + t1=tstamp(); + + /* version 1 */ + + //for(i=0;i +#include +#include +#define N 8192 + +int t[N][N]; + +static inline double tstamp(void) +{ + struct timespec tv; + clock_gettime(CLOCK_REALTIME, &tv); + return tv.tv_sec + tv.tv_nsec * 1.0e-9; +} + +int main() +{ + int i,j; + double t1,t2; + t1=tstamp(); + + /* version 1 */ + + for(i=0;i +#include "mem.h" + +int main(int argc,char * argv[]) +{ + int pages[] = {4,5,6,8,4,9,6,12,4,6,10}; + simu(4,pages,11); + +} diff --git a/SCR/TP01/memoire/mem.c b/SCR/TP01/memoire/mem.c new file mode 100644 index 0000000..3676a26 --- /dev/null +++ b/SCR/TP01/memoire/mem.c @@ -0,0 +1,174 @@ +#include "mem.h" +#include +#include +#include + +typedef struct frame { + int no; + int page; + int r; /* bit pour la seconde chance */ +} frame ; + + +typedef struct fifo { + int head; + int tail; + int nbelem; +} fifo; + +typedef struct mem { + int nbframes; + frame * frames; +} mem; + +static mem * memory=NULL; +static fifo FIFO; + + +/* Fifo est buffer circulaire + * head pointe sur la tete (element le plus ancien) + * tail pointe sur la queue (element le plus recent) + * nbelem represente le nombre d'element dans la file + * head et tail progressent modulo le nombre de frame + * dans la memoire */ +/* + * Memoire + ------------- + | frame 0 | <- head + ------------- + | frame 1 | + ------------- + | frame 2 | + ------------- + | frame 3 | + ------------- + | frame 4 | + ------------- + | ... | + ------------- + | ... | + ------------- + | ... | <- tail + ------------- + | ... | + ------------- +*/ + +static int init(int n) +{ + + int i; + memory = (mem*)calloc(1,sizeof(mem)); + memory-> nbframes = n; + memory-> frames = (frame *) calloc(n,sizeof(frame)); + if (memory -> frames == NULL) return -1; + + for(i=0;iframes[i].no = i; + memory->frames[i].page = -1; /* les frames sont vides initialement */ + memory->frames[i].r=0; + } + FIFO.head = FIFO.tail = 0; + FIFO.nbelem = 0; + return n; +} + +static int _page_is_in(int page) +{ +/* a ecrire */ +} + +static int _fifo_is_full() +{ + return (FIFO.nbelem == memory->nbframes); +} + +int get_page_2chance(int page) +{ +/* pour la deuxieme question */ +} + +int get_page_fifo(int page) +{ + /* a ecrire */ +} + +void simu(int nb_frame,int t[],int l) +{ + int i,j; + init(nb_frame); + frame ** trace; + trace = (frame **) malloc(sizeof(frame *) * l); + int * defaut = (int *) calloc(l,sizeof(int)); + for (i=0;iframes,sizeof(frame)*nb_frame); + } + printf("------------"); + for (i=0;iframes); + free(memory); + memory = NULL; + for(i=0;i +#include +#include + +typedef struct frame { + int no; + int page; + int r; /* bit pour la seconde chance */ +} frame ; + + +typedef struct fifo { + int head; + int tail; + int nbelem; +} fifo; + +typedef struct mem { + int nbframes; + frame * frames; +} mem; + +static mem * memory=NULL; +static fifo FIFO; + + +/* Fifo est buffer circulaire + * head pointe sur la tete (element le plus ancien) + * tail pointe sur la queue (element le plus recent) + * nbelem represente le nombre d'element dans la file + * head et tail progressent modulo le nombre de frame + * dans la memoire */ +/* + * Memoire + ------------- + | frame 0 | <- head + ------------- + | frame 1 | + ------------- + | frame 2 | + ------------- + | frame 3 | + ------------- + | frame 4 | + ------------- + | ... | + ------------- + | ... | + ------------- + | ... | <- tail + ------------- + | ... | + ------------- +*/ + +static int init(int n) +{ + + int i; + memory = (mem*)calloc(1,sizeof(mem)); + memory-> nbframes = n; + memory-> frames = (frame *) calloc(n,sizeof(frame)); + if (memory -> frames == NULL) return -1; + + for(i=0;iframes[i].no = i; + memory->frames[i].page = -1; /* les frames sont vides initialement */ + memory->frames[i].r=0; + } + FIFO.head = FIFO.tail = 0; + FIFO.nbelem = 0; + return n; +} + +static int _page_is_in(int page) +{ +/* a ecrire */ +} + +static int _fifo_is_full() +{ + return (FIFO.nbelem == memory->nbframes); +} + +int get_page_2chance(int page) +{ +/* pour la deuxieme question */ +} + +int get_page_fifo(int page) +{ + /* a ecrire */ +} + +void simu(int nb_frame,int t[],int l) +{ + int i,j; + init(nb_frame); + frame ** trace; + trace = (frame **) malloc(sizeof(frame *) * l); + int * defaut = (int *) calloc(l,sizeof(int)); + for (i=0;iframes,sizeof(frame)*nb_frame); + } + printf("------------"); + for (i=0;iframes); + free(memory); + memory = NULL; + for(i=0;i +#include +#include +#include +#include + +static inline double tstamp(void) +{ + struct timespec tv; + clock_gettime(CLOCK_REALTIME, &tv); + return tv.tv_sec + tv.tv_nsec * 1.0e-9; +} + +void shuffle(int *array, size_t n) +{ + if (n > 1) + { + size_t i; + for (i = 0; i < n - 1; i++) +// for (i = 0; i < n ; i++) + { + size_t j = i + rand() / (RAND_MAX / (n - i) + 1); +// size_t j = rand()%n; + int t = array[j]; + array[j] = array[i]; + array[i] = t; + } + } +} + +void init_access_c(int access[],size_t size) +{ + int i; + for(i=0;i +#include +#include + +#define BLOCK_SIZE 1 + + +int main(int argc, char *argv[]) +{ + int fin, fout; + char buf[BLOCK_SIZE]; + + assert( argc == 3 ); + + fin = open(argv[1],O_RDONLY); + assert( fin >= 0 ); + + fout = open(argv[2],O_CREAT|O_WRONLY|O_TRUNC,0600); + assert( fout >= 0 ); + + while(1){ + ssize_t nb_read; + nb_read = read(fin,buf,BLOCK_SIZE); + if (nb_read <= 0) + break; + write(fout,buf,nb_read); + } + + close(fin); + close(fout); + + return 0; +} + diff --git a/SCR/TP02/Q1/copy1.c~ b/SCR/TP02/Q1/copy1.c~ new file mode 100644 index 0000000..85f1589 --- /dev/null +++ b/SCR/TP02/Q1/copy1.c~ @@ -0,0 +1,34 @@ +#include +#include +#include + +#define BLOCK_SIZE 1 + + +int main(int argc, char *argv[]) +{ + int fin, fout; + char buf[BLOCK_SIZE]; + + assert( argc == 3 ); + + fin = open(argv[1],O_RDONLY); + assert( fin >= 0 ); + + fout = open(argv[2],O_CREAT|O_WRONLY|O_TRUNC,0600); + assert( fout >= 0 ); + + while(1){ + ssize_t nb_read; + nb_read = read(fin,buf,BLOCK_SIZE); + if (nb_read <= 0) + break; + write(fout,buf,nb_read); + } + + close(fin); + close(fout); + + return 0; +} + diff --git a/SCR/TP02/Q1/copy2.c b/SCR/TP02/Q1/copy2.c new file mode 100644 index 0000000..ae6ae70 --- /dev/null +++ b/SCR/TP02/Q1/copy2.c @@ -0,0 +1,30 @@ +#include +#include +#include + + +int main(int argc, char** argv){ + FILE* fichierScr = NULL; + FILE* fichierDes = NULL; + char caractere[2]; + int arg=0; + if (argc > 2){ + fichierDes = fopen(argv[2],"w"); + fichierScr = fopen(argv[1],"r"); + if (fichierScr){ + if (fichierDes){ + while (fread(caractere,sizeof(char),1,fichierScr)!=0){ + fwrite(caractere,sizeof(char),1,fichierDes); + } + return 0; + } + printf("%s n'existe pas ou ne peut pas s'ouvrir\n",argv[2]); + return 1; + } + printf("%s n'existe pas ou ne peut pas s'ouvrir\n",argv[1]); + return 1; + } + printf("Utilisation: argv[0] \n"); + return 0; +} + diff --git a/SCR/TP02/Q1/dest.txt b/SCR/TP02/Q1/dest.txt new file mode 100644 index 0000000..58e4fe6 Binary files /dev/null and b/SCR/TP02/Q1/dest.txt differ diff --git a/SCR/TP02/Q1/exe b/SCR/TP02/Q1/exe new file mode 100755 index 0000000..e061d0e Binary files /dev/null and b/SCR/TP02/Q1/exe differ diff --git a/SCR/TP02/Q1/origine.txt b/SCR/TP02/Q1/origine.txt new file mode 100644 index 0000000..58e4fe6 Binary files /dev/null and b/SCR/TP02/Q1/origine.txt differ diff --git a/SCR/TP02/coherence-test.txt b/SCR/TP02/coherence-test.txt new file mode 100644 index 0000000..f23912c --- /dev/null +++ b/SCR/TP02/coherence-test.txt @@ -0,0 +1 @@ +L'asr, c'est bien!! diff --git a/SCR/TP02/coherence.c b/SCR/TP02/coherence.c new file mode 100644 index 0000000..f9023e5 --- /dev/null +++ b/SCR/TP02/coherence.c @@ -0,0 +1,96 @@ +#include +#include +#include +#include +#include + +#define TESTFILE "coherence-test.txt" + +void write_asr_c_pas_bien() +{ + FILE* f = fopen(TESTFILE, "w"); + fprintf(f, "L'asr, c'est pas bien!\n"); + fclose(f); +} + +void write_asr_c_bien() +{ + FILE* f = fopen(TESTFILE, "w"); + fprintf(f, "L'asr, c'est bien!!\n"); + fclose(f); +} + + +void read_using_syscalls() +{ + write_asr_c_pas_bien(); + + // open file descriptor + int fd = open(TESTFILE, O_RDONLY); + + // read first 12 bytes + char buf[BUFSIZ]; + ssize_t nr1 = read(fd, buf, 12); + assert(nr1 >= 0); + + write_asr_c_bien(); + + // read rest of file, print to stdout + ssize_t nr2 = read(fd, buf + nr1, BUFSIZ - nr1); + close(fd); + fwrite(buf, 1, nr1 + nr2, stdout); +} + + +void read_using_stdio() +{ + write_asr_c_pas_bien(); + + // open stdio file + FILE* f = fopen(TESTFILE, "r"); + + // read first 12 bytes + char buf[BUFSIZ]; + size_t nr1 = fread(buf, 1, 12, f); + + write_asr_c_bien(); + + // read rest of file, print to stdout + size_t nr2 = fread(buf + nr1, 1, BUFSIZ - nr1, f); + fclose(f); + fwrite(buf, 1, nr1 + nr2, stdout); +} + + +static void usage() +{ + fprintf(stderr, "Usage: ./coherence -l (linux syscalls) or ./coherence -s (stdio)\n"); + exit(1); +} + +int main(int argc, char** argv) +{ + int which = 0; + + int opt; + while ((opt = getopt(argc, argv, "ls")) != -1) { + switch (opt) { + case 's': + which = 's'; + break; + case 'l': + which = 'l'; + break; + default: + usage(); + } + } + + if (which == 's') { + read_using_stdio(); + } else if (which == 'l') { + read_using_syscalls(); + } else { + usage(); + } +} diff --git a/SCR/TP02/copy.c~ b/SCR/TP02/copy.c~ new file mode 100644 index 0000000..b45f423 --- /dev/null +++ b/SCR/TP02/copy.c~ @@ -0,0 +1,35 @@ +#include +#include +#include + +#define BLOCK_SIZE 1 + + +int main(int argc, char *argv[]) +{ + int fin, + fout; + char buf[BLOCK_SIZE]; + + assert( argc == 3 ); + + fin = open(argv[1],O_RDONLY); + assert( fin >= 0 ); + + fout = open(argv[2],O_CREAT|O_WRONLY|O_TRUNC,0600); + assert( fout >= 0 ); + + while(1){ + ssize_t nb_read; + nb_read = read(fin,buf,BLOCK_SIZE); + if (nb_read <= 0) + break; + write(fout,buf,nb_read); + } + + close(fin); + close(fout); + + return 0; +} + diff --git a/SCR/TP02/copy2.c~ b/SCR/TP02/copy2.c~ new file mode 100644 index 0000000..85f1589 --- /dev/null +++ b/SCR/TP02/copy2.c~ @@ -0,0 +1,34 @@ +#include +#include +#include + +#define BLOCK_SIZE 1 + + +int main(int argc, char *argv[]) +{ + int fin, fout; + char buf[BLOCK_SIZE]; + + assert( argc == 3 ); + + fin = open(argv[1],O_RDONLY); + assert( fin >= 0 ); + + fout = open(argv[2],O_CREAT|O_WRONLY|O_TRUNC,0600); + assert( fout >= 0 ); + + while(1){ + ssize_t nb_read; + nb_read = read(fin,buf,BLOCK_SIZE); + if (nb_read <= 0) + break; + write(fout,buf,nb_read); + } + + close(fin); + close(fout); + + return 0; +} + diff --git a/SCR/TP02/exe b/SCR/TP02/exe new file mode 100755 index 0000000..4af5772 Binary files /dev/null and b/SCR/TP02/exe differ diff --git a/SCR/TP02/fadvise.c b/SCR/TP02/fadvise.c new file mode 100644 index 0000000..8dbc52e --- /dev/null +++ b/SCR/TP02/fadvise.c @@ -0,0 +1,155 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#define LINUX_FTOOLS_VERSION "1.0.0" +/** + +SYNTAX: filename mode [offset] [,length] +Where mode can be: + + POSIX_FADV_NORMAL No further special treatment. + POSIX_FADV_RANDOM Expect random page references. + POSIX_FADV_SEQUENTIAL Expect sequential page references. + POSIX_FADV_WILLNEED Will need these pages. + POSIX_FADV_DONTNEED Don't need these pages. + POSIX_FADV_NOREUSE Data will be accessed once. + +Allows an application to to tell the kernel how it expects to use a file handle, +so that the kernel can choose appropriate read-ahead and caching techniques for +access to the corresponding file. This is similar to the POSIX version of the +madvise system call, but for file access instead of memory access. The +sys_fadvise64() function is obsolete and corresponds to a broken glibc API, +sys_fadvise64_64() is the fixed version. The following are the values for the +advice parameter: + +FADV_NORMAL + +No special treatment. + +FADV_RANDOM + +Expect page references in random order. + +FADV_SEQUENTIAL + +Expect page references in sequential order. + +FADV_WILLNEED + +Expect access in the near future. + +FADV_DONTNEED + +Do not expect access in the near future. Subsequent access of pages in this +range will succeed, but will result either in reloading of the memory contents +from the underlying mapped file or zero-fill-in-demand pages for mappings +without an underlying file. + +FADV_NOREUSE + +Access data only once. + +*/ +int main(int argc, char *argv[]) { + + if ( argc < 3 ) { + fprintf( stderr, "%s version %s\n", argv[0], LINUX_FTOOLS_VERSION ); + printf( "SYNTAX: fadvise filename mode [offset] [,length]\n" ); + + printf( "Where mode can be:\n\n" ); + + printf( " POSIX_FADV_NORMAL No further special treatment. \n" ); + printf( " POSIX_FADV_RANDOM Expect random page references. \n" ); + printf( " POSIX_FADV_SEQUENTIAL Expect sequential page references. \n" ); + printf( " POSIX_FADV_WILLNEED Will need these pages. \n" ); + printf( " POSIX_FADV_DONTNEED Don't need these pages. \n" ); + printf( " POSIX_FADV_NOREUSE Data will be accessed once. \n" ); + + exit( 1 ); + } + + char* path = argv[1]; + char* param_mode = argv[2]; + + printf( "Going to fadvise %s\n", path ); + + int flags = O_RDWR; + int fd = open( path, flags ); + + if ( fd == -1 ) { + perror( NULL ); + return 1; + } + + struct stat fd_stat ; + + if ( fstat( fd, &fd_stat ) < 0 ) { + perror( "Could not stat file: " ); + return 1; + } + + loff_t offset = 0; + loff_t length = fd_stat.st_size; + + if ( argc >= 4 ) { + offset = strtol( argv[3], NULL, 10 ); + } + + if ( argc >= 5 ) { + length = strtol( argv[4], NULL, 10 ); + } + + printf( "offset: %ld\n", offset ); + printf( "length: %ld\n", length ); + + int mode = -1; + + if ( strcmp( param_mode , "POSIX_FADV_NORMAL" ) == 0 ) { + mode = POSIX_FADV_NORMAL; + } else if ( strcmp( param_mode , "POSIX_FADV_RANDOM" ) == 0 ) { + mode = POSIX_FADV_RANDOM; + } else if ( strcmp( param_mode , "POSIX_FADV_SEQUENTIAL" ) == 0 ) { + mode = POSIX_FADV_SEQUENTIAL; + } else if ( strcmp( param_mode , "POSIX_FADV_WILLNEED" ) == 0 ) { + mode = POSIX_FADV_DONTNEED; + } else if ( strcmp( param_mode , "POSIX_FADV_DONTNEED" ) == 0 ) { + mode = POSIX_FADV_DONTNEED; + } else if ( strcmp( param_mode , "POSIX_FADV_NOREUSE" ) == 0 ) { + mode = POSIX_FADV_NOREUSE; + } else { + printf( "Invalid mode %s\n", param_mode ); + exit( 1 ); + } + + printf( "mode: %s\n", param_mode ); + + long result = syscall( SYS_fadvise64, fd, offset, length , mode ); + + if ( result != 0 ) { + + if ( result != -1 ) { + errno=result; + perror( "Unable to fadvise" ); + } else { + printf( "Unable to fadvise: %ld\n" , result ); + } + + return 1; + } + + printf( "WIN\n" ); + + close( fd ); + return 0; + +} diff --git a/SCR/TP02/my_cp_map.c b/SCR/TP02/my_cp_map.c new file mode 100644 index 0000000..c425b68 --- /dev/null +++ b/SCR/TP02/my_cp_map.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include +#include + + +#define BUFSIZE 1024 + + +static inline double tstamp(void) +{ + struct timespec tv; + clock_gettime(CLOCK_REALTIME, &tv); + return tv.tv_sec + tv.tv_nsec * 1.0e-9; +} + +int main(int argc, char *argv[]) +{ + //char buf[BUFSIZE]; + char * bufin = NULL, + * bufout = NULL; + + + int fin, + fout; + + double start, + end; + + size_t filesize = 0; + + assert(argc == 3); + + start = tstamp(); + + fin = open(argv[1],O_RDONLY); + assert(fin >=0); + + fout = open(argv[2],O_RDWR|O_CREAT|O_TRUNC,0600); + assert(fout >=0); + + filesize = lseek(fin,0,SEEK_END); + ftruncate (fout,filesize); + + bufin = mmap(NULL,filesize,PROT_READ,MAP_PRIVATE,fin,0); + assert(bufin != (void*)-1); + + bufout = mmap(NULL,filesize,PROT_WRITE,MAP_SHARED,fout,0); + + assert(bufout != (void*)-1); + + + memcpy(bufout,bufin,filesize); + + //munmap(bufin,filesize); + //munmap(bufout,filesize); + + //ssize_t nb_read = read(fin,buf,sizeof(buf)); + close(fin); + close(fout); + + end = tstamp(); + + printf("time = %.3lf\n",end - start); + return 0; +} diff --git a/SCR/TP02/origine.txt~ b/SCR/TP02/origine.txt~ new file mode 100644 index 0000000..e69de29 diff --git a/SCR/TP02/reponse.txt b/SCR/TP02/reponse.txt new file mode 100644 index 0000000..a21a956 --- /dev/null +++ b/SCR/TP02/reponse.txt @@ -0,0 +1,10 @@ +time ./exe +=> affiche le temps d'execution + +dd if=/dev/urandom of=toto.dat bs=1k count=1k +=> creer un fichier + +diff file1 file2 +=> compare 2 fichier + +strace diff --git a/SCR/TP02/reponse.txt~ b/SCR/TP02/reponse.txt~ new file mode 100644 index 0000000..e69de29 diff --git a/SCR/TP03/copy1byte.c b/SCR/TP03/copy1byte.c new file mode 100644 index 0000000..fab6100 --- /dev/null +++ b/SCR/TP03/copy1byte.c @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define msg1 "je suis le pere" +#define msg2 "je suis le fils !!!" + +int main(int argc,char * argv[]){ + + int infd,outfd; + ssize_t nbread; + char buf[1]; + pid_t p; + + if (argc != 3){ + + printf("%s infile outfile\n",argv[0]); + exit(1); + } + + infd = open(argv[1],O_RDONLY); + assert(infd >= 0); + outfd = open(argv[2],O_WRONLY|O_CREAT|O_TRUNC,0644); + assert(outfd >= 0); + + p=fork(); // <- decommentez cette ligne + + while(1){ + + nbread=read(infd,buf,sizeof(buf)); + if (nbread <=0 ) break; + write(outfd,buf,sizeof(buf)); + + } + + + close(infd); + close(outfd); +} diff --git a/SCR/TP03/copy1byte.c~ b/SCR/TP03/copy1byte.c~ new file mode 100644 index 0000000..02fe937 --- /dev/null +++ b/SCR/TP03/copy1byte.c~ @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define msg1 "je suis le pere" +#define msg2 "je suis le fils !!!" + +int main(int argc,char * argv[]){ + + int infd,outfd; + ssize_t nbread; + char buf[1]; + pid_t p; + + if (argc != 3){ + + printf("%s infile outfile\n",argv[0]); + exit(1); + } + + infd = open(argv[1],O_RDONLY); + assert(infd >= 0); + outfd = open(argv[2],O_WRONLY|O_CREAT|O_TRUNC,0644); + assert(outfd >= 0); + + //p=fork(); // <- decommentez cette ligne + + while(1){ + + nbread=read(infd,buf,sizeof(buf)); + if (nbread <=0 ) break; + write(outfd,buf,sizeof(buf)); + + } + + + close(infd); + close(outfd); +} diff --git a/SCR/TP03/ex1-stdio.c b/SCR/TP03/ex1-stdio.c new file mode 100644 index 0000000..4bc5de2 --- /dev/null +++ b/SCR/TP03/ex1-stdio.c @@ -0,0 +1,12 @@ +#include +#include +#include + + +int main(){ + + printf("NON"); + if (fork()) { + printf("OUI\n"); + } +} diff --git a/SCR/TP03/ex1-syscall.c b/SCR/TP03/ex1-syscall.c new file mode 100644 index 0000000..1b46b6a --- /dev/null +++ b/SCR/TP03/ex1-syscall.c @@ -0,0 +1,14 @@ +#include +#include +#include + + +int main(){ + + //printf("NON"); + write(STDOUT_FILENO,"NON",3); + if (fork()) { + //printf("OUI\n"); + write(STDOUT_FILENO,"OUI\n",4); + } +} diff --git a/SCR/TP03/ex2.txt b/SCR/TP03/ex2.txt new file mode 100644 index 0000000..e9224df --- /dev/null +++ b/SCR/TP03/ex2.txt @@ -0,0 +1,5 @@ +je suis alexis et je suis vraiment crazy !!! (: +je suis alexis et je suis vraiment crazy !!! (: +je suis alexis et je suis vraiment crazy !!! (: +je suis alexis et je suis vraiment crazy !!! (: +je suis alexis et je suis vraiment crazy !!! (: diff --git a/SCR/TP03/ex2.txt~ b/SCR/TP03/ex2.txt~ new file mode 100644 index 0000000..49b56dc --- /dev/null +++ b/SCR/TP03/ex2.txt~ @@ -0,0 +1 @@ +je suis alexis et je suis vraiment crazy !!! (: diff --git a/SCR/TP03/ex3.txt b/SCR/TP03/ex3.txt new file mode 100644 index 0000000..9501a2f --- /dev/null +++ b/SCR/TP03/ex3.txt @@ -0,0 +1,5 @@ +j esuis alexis et je suis vraiment crazy !!! (: +je suis alexis t jee suis vraiment crazy !!! (: +je uiss alexis et je suis vraiment crazy !!! (: +je suis alexis et je suis vraiment crazy !!! (: +je suis alexis et je suis vraiment crazy !!! (: diff --git a/SCR/TP03/ex4.c b/SCR/TP03/ex4.c new file mode 100644 index 0000000..ef70cae --- /dev/null +++ b/SCR/TP03/ex4.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include + + +int main(){ + int pid = fork(); + if (pid == -1) { + exit(0); + } + if (pid == 0) { + printf("fork = %d, pid = %d, ppid = %d\n",pid,getpid(),getppid()); + sleep(4); + exit(2); + } + if (pid > 0) { + printf("fork = %d, pid = %d, ppid = %d\n",pid,getpid(),getppid()); + printf("%d\n",wait()); + exit(2); + } +} diff --git a/SCR/TP03/ex4.c~ b/SCR/TP03/ex4.c~ new file mode 100644 index 0000000..4bc5de2 --- /dev/null +++ b/SCR/TP03/ex4.c~ @@ -0,0 +1,12 @@ +#include +#include +#include + + +int main(){ + + printf("NON"); + if (fork()) { + printf("OUI\n"); + } +} diff --git a/SCR/TP03/ex5.c b/SCR/TP03/ex5.c new file mode 100644 index 0000000..5110cad --- /dev/null +++ b/SCR/TP03/ex5.c @@ -0,0 +1,124 @@ +#include +#include +#include +#include + +#define SIZE 1000 +int search0(const unsigned char * t,int start,int end) +{ + int i; + for (i=start; i 0){ + if (search0(t,milieu+1,end)){ + return 1; + } + wait(&status); + return WEXITSTATUS(status); + } + return 0; +} + +int search2(const unsigned char * t,int start,int end) +{ + int i; + int nbFils; + int taille = (end-start); + int pid; + int status; + + printf("Enter a number between 0 and 100: ", SIZE); + scanf(" %d", &nbFils); + for (int i=0; i= 0 && i < SIZE) arr[i] = 0; + + if (search3(arr,0,SIZE-1)) + printf("Found !\n"); + else + printf("Not found !\n"); + return EXIT_SUCCESS; +} diff --git a/SCR/TP03/ex5.c~ b/SCR/TP03/ex5.c~ new file mode 100644 index 0000000..487db31 --- /dev/null +++ b/SCR/TP03/ex5.c~ @@ -0,0 +1,36 @@ +#include +#include +#include + +#define SIZE 1000 +int search0(const unsigned char * t,int start,int end) +{ + int i; + for (i=start; i= 0 && i < SIZE) arr[i] = 0; + + if (search0(arr,0,SIZE-1)) + printf("Found !\n"); + else + printf("Not found !\n"); + return EXIT_SUCCESS; +} diff --git a/SCR/TP03/exe b/SCR/TP03/exe new file mode 100755 index 0000000..bba4a4c Binary files /dev/null and b/SCR/TP03/exe differ diff --git a/SCR/TP03/fork_and_fd1.c b/SCR/TP03/fork_and_fd1.c new file mode 100644 index 0000000..2c529b9 --- /dev/null +++ b/SCR/TP03/fork_and_fd1.c @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define msg1 "je suis le pere" +#define msg2 "je suis le fils !!!" + +int main(int argc,char * argv[]){ + + int outfd; + pid_t p; + + if (argc != 2){ + + printf("%s file\n",argv[0]); + exit(1); + } + + //p=fork(); + outfd = open(argv[1],O_WRONLY|O_CREAT,0644); + assert(outfd >= 0); + p=fork(); + switch(p){ + case (pid_t)-1 : + perror(NULL); + exit(2); + + case (pid_t)0 : + write(outfd,msg2,strlen(msg2)); + break; + default : + write (outfd,msg1,strlen(msg1)); + break; + } + close(outfd); +} diff --git a/SCR/TP03/fork_and_fd2.c b/SCR/TP03/fork_and_fd2.c new file mode 100644 index 0000000..7a63fe5 --- /dev/null +++ b/SCR/TP03/fork_and_fd2.c @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define msg1 "je suis le pere" +#define msg2 "je suis le fils !!!" + +int main(int argc,char * argv[]){ + + int outfd; + pid_t p; + + if (argc != 2){ + + printf("%s file\n",argv[0]); + exit(1); + } + + p=fork(); + outfd = open(argv[1],O_WRONLY|O_CREAT,0644); + assert(outfd >= 0); + //p=fork(); + switch(p){ + case (pid_t)-1 : + perror(NULL); + exit(2); + + case (pid_t)0 : + write(outfd,msg2,strlen(msg2)); + break; + default : + write (outfd,msg1,strlen(msg1)); + break; + } + close(outfd); +} diff --git a/SCR/TP03/reponse.txt b/SCR/TP03/reponse.txt new file mode 100644 index 0000000..11deb16 --- /dev/null +++ b/SCR/TP03/reponse.txt @@ -0,0 +1,10 @@ +1) +le 1er non est écrit dans un cache. ensuite le programme se divise, et le non apparait donc 2 fois + +2) +Dans le premier cas, un seul processus ouvre le fichier. +je suis le pere !!!je suis le fils !!! +Dans le deuxième cas le fichier est ouvert et modifier 2 fois simultanément. +je suis le pere !!!uis le fils !!! + +3) diff --git a/SCR/TP03/reponse.txt~ b/SCR/TP03/reponse.txt~ new file mode 100644 index 0000000..5e36ce0 --- /dev/null +++ b/SCR/TP03/reponse.txt~ @@ -0,0 +1 @@ +1) diff --git a/SCR/TP03/session.c b/SCR/TP03/session.c new file mode 100644 index 0000000..2298fef --- /dev/null +++ b/SCR/TP03/session.c @@ -0,0 +1,18 @@ +#include +#include + + + +int main(int argc, char *argv[]) +{ + if (fork()){ + printf("session = %d\n",getsid(getpid())); + while(1); + } else { + setsid(); + printf("session = %d\n",getsid(getpid())); + while(1); + } + return 0; +} + diff --git a/SCR/TP04/ex1.c b/SCR/TP04/ex1.c new file mode 100644 index 0000000..c5d6844 --- /dev/null +++ b/SCR/TP04/ex1.c @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +#include + +uint64_t shots_in=0,shots=0; +double x,y, pi; + +void point(){ + x = rand()/(RAND_MAX*1.0); + y = rand()/(RAND_MAX*1.0); + shots ++; + if ((x*x+y*y)<=1){ + shots_in ++; + } + pi = ((double)shots_in)/((double)shots)*4.0; +} + +void sig_alarm(int signum){ + printf("pi = %lf\n", pi); + alarm(5); +} +void sig_int(int signum){ + char reponse; + printf("voulez vous réellement arrêter le programme ? (y/n)\n"); + scanf("%c", &reponse); + if (reponse == 'y'){ + exit(0); + } +} +void sig_quit(int signum){ + printf(" REINITIALISATION /^\n"); + shots_in = 0; + shots = 0; + point(); +} + +int set_signal_handler(int signo, void (*handler)(int)) { + struct sigaction sa; + sa.sa_handler = handler; // call `handler` on signal + sigemptyset(&sa.sa_mask); // don't block other signals in handler + sa.sa_flags = SA_RESTART; // restart system calls + return sigaction(signo, &sa, NULL); +} + +int main(int argc, char **argv) +{ + shots_in = 0; + shots = 0; + + set_signal_handler(SIGALRM,sig_alarm); + set_signal_handler(SIGINT, sig_int); + set_signal_handler(SIGQUIT, sig_quit); + alarm(5); + + for (;;){ + point(); + } +} diff --git a/SCR/TP04/ex1.c~ b/SCR/TP04/ex1.c~ new file mode 100644 index 0000000..3e57656 --- /dev/null +++ b/SCR/TP04/ex1.c~ @@ -0,0 +1,60 @@ +#include +#include +#include +#include +#include +#include + +uint64_t shots_in=0,shots=0; +double x,y, pi; + +void point(){ + x = rand()/(RAND_MAX*1.0); + y = rand()/(RAND_MAX*1.0); + shots ++; + if ((x*x+y*y)<=1){ + shots_in ++; + } + pi = ((double)shots_in)/((double)shots)*4.0; +} + +void sig_alarm(int signum){ + printf("pi = %lf\n", pi); + alarm(5); +} +void sig_int(int signum){ + char reponse; + printf("voulez vous réellement arrêter le programme ? (y/n)\n"); + scanf("%c", &reponse); + if (reponse == 'y'){ + exit(0); + } +} +void sig_quit(int signum){ + shots_in = 0; + shots = 0; + point(); +} + +int set_signal_handler(int signo, void (*handler)(int)) { + struct sigaction sa; + sa.sa_handler = handler; // call `handler` on signal + sigemptyset(&sa.sa_mask); // don't block other signals in handler + sa.sa_flags = SA_RESTART; // restart system calls + return sigaction(signo, &sa, NULL); +} + +int main(int argc, char **argv) +{ + shots_in = 0; + shots = 0; + + set_signal_handler(SIGALRM,sig_alarm); + set_signal_handler(SIGINT, sig_int); + set_signal_handler(SIGQUIT, sig_quit); + alarm(5); + + for (;;){ + point(); + } +} diff --git a/SCR/TP04/exe b/SCR/TP04/exe new file mode 100755 index 0000000..daf86b3 Binary files /dev/null and b/SCR/TP04/exe differ diff --git a/SCR/TP04/helpers.c b/SCR/TP04/helpers.c new file mode 100644 index 0000000..718fe40 --- /dev/null +++ b/SCR/TP04/helpers.c @@ -0,0 +1,19 @@ +#include "helpers.h" +#include +#include + +int set_signal_handler(int signo, void (*handler)(int)) { + struct sigaction sa; + sa.sa_handler = handler; // call `handler` on signal + sigemptyset(&sa.sa_mask); // don't block other signals in handler + sa.sa_flags = SA_RESTART; // restart system calls + return sigaction(signo, &sa, NULL); +} + +double tstamp(void) { + struct timespec tv; + clock_gettime(CLOCK_REALTIME, &tv); + return tv.tv_sec + tv.tv_nsec * 1.0e-9; +} + + diff --git a/SCR/TP04/helpers.h b/SCR/TP04/helpers.h new file mode 100644 index 0000000..2084c6a --- /dev/null +++ b/SCR/TP04/helpers.h @@ -0,0 +1,7 @@ +#ifndef _HELPERS_H +#define _HELPERS_H + +int set_signal_handler(int signo, void (*handler)(int)); +double tstamp(void); + +#endif diff --git a/SCR/TP04/pi.c b/SCR/TP04/pi.c new file mode 100644 index 0000000..08856a5 --- /dev/null +++ b/SCR/TP04/pi.c @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include +#include +#include "helpers.h" + + +uint64_t shots = 0, + shots_in = 0; + +double pi = 0, + t1; + +int main(int argc,char * argv[]) +{ + double x,y; + t1 = tstamp(); + + alarm(5); + + while(1){ + x = ((double)rand())/(double)RAND_MAX; + y = ((double)rand())/(double)RAND_MAX; + shots ++; + + if ((x*x+y*y) <= 1) + shots_in ++; + } +} diff --git a/SCR/TP04/ping_pong.c b/SCR/TP04/ping_pong.c new file mode 100644 index 0000000..2ae839a --- /dev/null +++ b/SCR/TP04/ping_pong.c @@ -0,0 +1,58 @@ +#include +#include +#include +#include +#include +#include +#include + +#define N 10000 +void sig_hand(int sig) {} + +sigset_t saveMask, blockMask; + +void player_wait(){ + pause(); +} +void child_process() +{ + int x = 0; + while(x < N) + { + player_wait(); + printf("\tPong %d!\n", ++x); + kill(getppid(), SIGUSR1); + } + return ; +} + +void parent_process(pid_t pid) +{ + int y = 0; + while (y < N) + { + printf("Ping %d!\n", ++y); + kill(pid, SIGUSR1); + player_wait(); + } + return ; +} + +int main(int argc, char* argv[]) +{ + //set up signal handler for parent & child + struct sigaction sa; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sa.sa_handler = sig_hand; + + assert (sigaction(SIGUSR1, &sa, NULL) != -1); + + pid_t pid = fork(); + + if (pid == 0) + child_process(); + else + parent_process(pid); + return 0; +} diff --git a/SCR/TP04/section_critique.c b/SCR/TP04/section_critique.c new file mode 100644 index 0000000..04725f4 --- /dev/null +++ b/SCR/TP04/section_critique.c @@ -0,0 +1,34 @@ +#include +#include +#include +#include +#include +#include +#include "helpers.h" + + +int x=2,y=3; + +int swap(int *x,int *y) +{ + int tmp=*x; + *x=*y; + *y=tmp; +} + +void sig_handler(int signo) +{ + switch(signo){ + case SIGQUIT : + printf("x=%d y=%d\n",x,y); + break; + } +} + +int main(int argc,char * argv[]) +{ + assert(set_signal_handler(SIGQUIT,sig_handler)==0); + while(1){ + swap(&x,&y); + } +} diff --git a/SCR/TP05/ex1 b/SCR/TP05/ex1 new file mode 100755 index 0000000..4fc5625 Binary files /dev/null and b/SCR/TP05/ex1 differ diff --git a/SCR/TP05/ex1.c b/SCR/TP05/ex1.c new file mode 100644 index 0000000..e1e10c6 --- /dev/null +++ b/SCR/TP05/ex1.c @@ -0,0 +1,17 @@ +#include +#include +#include + +int main(int argc, char* argv[]){ + int t[2]; + char p; + int nbchar = 0; + pipe(t); + while (write(t[1],&p,sizeof(char)) > 0){ + nbchar ++; + printf("%d\n",nbchar); + } + close(t[0]); + close(t[1]); + return 0; +} \ No newline at end of file diff --git a/SCR/TP05/ex2.c b/SCR/TP05/ex2.c new file mode 100644 index 0000000..5c72c98 --- /dev/null +++ b/SCR/TP05/ex2.c @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include + +int main() { + char *command1[] = {"ls","ls", "-l", NULL}; + char *command2[] = {"wc","wc", "-l", NULL}; + int p[2]; + + pipe(p); + pid_t pid = fork(); + + if (pid == 0) { + close(p[1]); + dup2(p[0], STDIN_FILENO); + execvp(command2[0], command2+1); + exit(-1); + } + else{ + close(p[0]); + dup2(p[1], STDOUT_FILENO); + execvp(command1[0], command1+1); + exit(-1); + } + return 0; +} \ No newline at end of file diff --git a/SCR/TP05/ex3.c b/SCR/TP05/ex3.c new file mode 100644 index 0000000..0eedc2f --- /dev/null +++ b/SCR/TP05/ex3.c @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include + +int main() { + char *command1[] = {"ls","ls", ".", NULL}; + char *command2[] = {"wc","wc", "-l", NULL}; + int p[2]; + + pipe(p); + pid_t pid = fork(); + + if (pid == 0) { + close(p[0]); + dup2(p[1], STDOUT_FILENO); + execvp(command1[0], &command1[1]); + close(p[1]); + exit(0); + } + else{ + close(p[1]); + dup2(p[0], STDIN_FILENO); + //dup2(STDIN_FILENO,p[0]); + execvp(command2[0], &command2[1]); + close(p[0]); + exit(0); + } + return 0; +} \ No newline at end of file diff --git a/SCR/TP05/exe b/SCR/TP05/exe new file mode 100755 index 0000000..4fc5625 Binary files /dev/null and b/SCR/TP05/exe differ diff --git a/SCR/TP05/pipe-ex.c b/SCR/TP05/pipe-ex.c new file mode 100644 index 0000000..f9260e3 --- /dev/null +++ b/SCR/TP05/pipe-ex.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include + +int main() { + int ecrit; + int lu; + int p[2]; + + pipe(p); + pid_t pf = fork(); + + if (pf == 0) { + pid_t pf1 = fork(); + if (pf1 == 0) { + while (read(p[0],&lu,sizeof(int)) > 0){ + printf("%d received %d\n", getpid(), lu); + } + } + } + else{ + pid_t pf2 = fork(); + if (pf2 == 0) { + } + else{ + while(1){ + sleep(3); + ecrit = getpid(); + printf("%d sent %d\n", ecrit, ecrit); + write(p[1],&ecrit,sizeof(int)); + } + } + } +} \ No newline at end of file diff --git a/SCR/TP06/ex1 b/SCR/TP06/ex1 new file mode 100755 index 0000000..fdfbfff Binary files /dev/null and b/SCR/TP06/ex1 differ diff --git a/SCR/TP06/ex1.c b/SCR/TP06/ex1.c new file mode 100644 index 0000000..7fa2a2e --- /dev/null +++ b/SCR/TP06/ex1.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +#define NUM_THREADS 16 + +void *thread(void *thread_id) { + int id = *((int *) thread_id); + printf("Hello from thread %d\n", id); + + return NULL; +} + +int main() { + pthread_t threads[NUM_THREADS]; + int tabid[NUM_THREADS]; + for (int i = 0; i < NUM_THREADS; i++){ + tabid[i] = i+1; + } + for (int i = 0; i < NUM_THREADS; i++){ + assert( pthread_create(&threads[i], NULL, thread, &tabid[i]) == 0); + } + + for (int i = 0; i < NUM_THREADS; i++){ + assert( pthread_join(threads[i], NULL) == 0); + } + + return EXIT_SUCCESS; +} diff --git a/SCR/TP06/ex2.c b/SCR/TP06/ex2.c new file mode 100644 index 0000000..8c254f4 --- /dev/null +++ b/SCR/TP06/ex2.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include + +typedef struct duel{ + int participant1; + int participant2; +} duel; + +void *tournois(void *thread_id) { + int id = *((int *) thread_id); + printf("Hello from thread %d\n", id); + + return NULL; +} + +int puissance2(int n){ + for (int p=1; pnom = argv[i]; + participant->id = i; + } + while (nbDuel > 1){ + for (int i = 0; i < nbDuel; i++){ + duel[nbDuel] tabDuel; + participant participant2; + for (int x=0, y=0, ) + participant duel[] = {participant[i], participant[i+1]}; + assert( pthread_create(&threads[i], NULL, tournois, &participant[i]) == 0); + } + for (int i = 0; i < NUM_THREADS; i++){ + assert( pthread_join(threads[i], NULL) == 0); + } + + nbParticipant /= 2; + nbDuel /= 2; + } + + return EXIT_SUCCESS; +} diff --git a/SCR/src.tar.gz b/SCR/src.tar.gz new file mode 100644 index 0000000..3bac26e Binary files /dev/null and b/SCR/src.tar.gz differ diff --git a/rien/stat_peche.txt b/rien/stat_peche.txt new file mode 100755 index 0000000..4b67310 --- /dev/null +++ b/rien/stat_peche.txt @@ -0,0 +1,11 @@ +poisson +12 + +boite +4 + +cannette +16 + +botte +7 \ No newline at end of file diff --git a/user_stories.txt b/user_stories.txt new file mode 100644 index 0000000..b6d8c4b --- /dev/null +++ b/user_stories.txt @@ -0,0 +1,36 @@ +1ère user story : + L'user se connecte et se déconnecte + +2ème : + Si connecté -> pourra chercher un stage (peut mettre en favori le stage) + Si un stage est choisi -> peut écrire une convention sur ce stage (extraction des données sur le stage choisi) + -> Modifier/Compléter la convention + -> Envoi de la convention à l'entreprise + -> En attente de réponse de l'entreprise (notification de l'entreprise lors de réponse) + -> Consulter le message (notification/convention) de l'entreprise + -> Modification ou signature + +PDV ENTREPRISE : + Peut consulter une convention reçu : + - Validation de la convention + -> Envoi une réponse à l'étudiant + - Modification de la convention reçu (+ ou - grosse) + -> Renvoi de la convention + - Refus de la convention + -> Envoi de la réponse à l'étudiant + + +Télécharger la convention signée + +se connecter mais se tromper + + +Ne pas être connecté -> chercher des stage -> en mettre un en favoris / écrire une convention -> se connecter -> reprendre là ou on en était + +commencer une convention mais la terminer plus tard + +----------------------------------- + +Modifier son profil + +consulter les informations générales sur le stage (et l'iut). \ No newline at end of file