Compare commits

..

34 Commits

Author SHA1 Message Date
40cd963202 uml 2024-01-21 16:40:11 +01:00
d2ffcf8c9a Synthèse os 2024-01-18 15:46:08 +01:00
a66a649b48 exam modal dev aout 2023 2024-01-14 10:00:35 +01:00
df9e43e534 chap4 2023-12-21 23:39:21 +01:00
babed7eb09 chap3 2023-12-21 23:36:03 +01:00
990b77ed18 Adding reference to the uml 2.0 reference 2023-11-21 15:40:17 +01:00
025b0e2166 useCase prototype 2023-11-20 19:11:26 +01:00
c4e193e45f use case diagram 2023-11-17 16:10:39 +01:00
3b2f4c84d7 Merge remote-tracking branch 'refs/remotes/origin/bac2' into bac2 2023-11-08 09:43:08 +01:00
58acfde2b4 chap3 2023-11-08 09:42:46 +01:00
dabb46879d . 2023-10-24 20:28:37 +02:00
0424fbcca6 . 2023-10-24 20:25:22 +02:00
dfe4fd3729 exo 1 + pgl 2023-10-24 15:48:13 +02:00
2649bc9a54 Group project
Alone because I have not friend haha (jk)
2023-10-24 12:19:02 +02:00
d35439f7d3 . 2023-10-24 10:40:15 +02:00
5a7048a0a4 removing ex<num> bin files 2023-10-18 20:47:38 +02:00
d5ca967c0c remove bin 2023-10-18 20:33:56 +02:00
b0f02b0d5d . 2023-10-18 20:27:40 +02:00
4de4dcf2c2 adding latex 2023-09-21 08:24:22 +02:00
4fd7542f03 . 2023-09-20 15:18:20 +02:00
00d0cdfaf3 function 2023-05-08 09:32:14 +02:00
d0ef521917 hexa fixup 2023-05-08 09:32:02 +02:00
690720e54d hexa 2023-05-05 16:04:44 +02:00
a526edbd8d move 2023-05-05 13:05:41 +02:00
dcb24a67d0 folders 2023-05-05 13:05:06 +02:00
820bd8d1ad tps 2023-05-05 13:04:40 +02:00
cac30ebbb1 update 2023-05-05 13:02:58 +02:00
23a079c89a moving files 2023-04-26 11:24:50 +02:00
454ac6e17e reorganisation + hashmap 2023-04-26 11:24:13 +02:00
c561eda0cf pdf tp7
Signed-off-by: Debucquoy Anthony <d.tonitch@gmail.com>
2023-04-26 11:21:21 +02:00
5456020f7c tp2 2023-03-09 11:38:23 +01:00
d3c715a655 tp3 2023-03-09 07:38:52 +01:00
2109fa74c0 moving files 2023-02-15 13:40:50 +01:00
93ae5a67d2 cours 2 algo 2023-02-14 17:45:04 +01:00
374 changed files with 20242 additions and 39 deletions

14
.gitignore vendored
View File

@ -1,2 +1,16 @@
__pycache__/
*.tar
*.class
*.toc
*.synctex.gz
*.snm
*.out
*.aux
*.fbd_latexmk
*.fls
*.log
*.nav
*.fdb_latexmk
a.out
*.o
ex[0-9]

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "bac2/latex/beamer-umons"]
path = bac2/latex/beamer-umons
url = git@github.com:Chris00/beamer-umons

View File

@ -1,39 +0,0 @@
#!/bin/python
""" Compression
Usage:
compression.py (-c|-d) -t <type> --in <input> [--out <output>]
compression.py -h | --help
compression.py --version
Options:
-h --help Show this screen
--version Show Version
-c Compress
-d Decompress
-t Choose Compression Type
--in Input file
--out Output file
"""
def read_file(filename:str):
try:
with open(filename) as file:
return file.readall()
except e:
print(e)
def lz_compression(text:str):
"""compress all duplicate word
put each word into a list and make make a string of all the occurence
:text: string to compress
:returns: tuple with (list of word, decoding string)
"""
splitted_text = text.split()
if __name__ == "__main__":
from docopt import docopt
argument = docopt(__doc__, version="V1")

Binary file not shown.

90
bac1/q1/01dec/compress.py Executable file
View File

@ -0,0 +1,90 @@
#!/bin/python
""" Compression
Usage:
compression.py (-c|-d) -t <type> --in <input> [--out <output>]
compression.py -h | --help
compression.py --version
Options:
-h --help Show this screen
--version Show Version
-c Compress
-d Decompress
-t Choose Compression Type (currently supported: lz, rle)
--in Input file
--out Output file
"""
def read_file(filename:str) -> str:
try:
with open(filename) as file:
return file.read()
except e:
print(e)
def lz_compression(text:str):
"""compress all duplicate word
put each word into a list and make make a string of all the occurence
:text: string to compress
:returns: tuple with (list of word, decoding string)
"""
splitted_text = text.split()
word_list = list()
key = dict()
key_value = 0
for v in splitted_text:
if v not in key.keys():
key[v] = key_value
key_value += 1
word_list.append(key[v])
return word_list, key
def save_lz(filename, word_list, key_list):
with open(filename, 'w') as file:
word_list = map(str, word_list)
file.writelines(' '.join(word_list))
file.writelines(' '.join(list(key_list.items())))
def lz_decompression(text:str):
pass
def rle_compression(text:str):
"""compress all duplicate word
put each word into a list and make make a string of all the occurence
:text: string to compress
:returns: tuple with (list of word, decoding string)
"""
splitted_text = text.split()
def rle_decompression(text:str):
pass
if __name__ == "__main__":
from docopt import docopt
argument = docopt(__doc__, version="V1")
print(argument)
if argument['<type>'].lower() == 'lz':
if argument['-d']:
result = lz_decompression(read_file(argument['<input>']))
print(result)
if argument['-c']:
w_list, k_list = lz_compression(read_file(argument['<input>']))
save_lz('test.Ltxt', w_list, k_list)
elif argument['<type>'].lower() == 'rle':
if argument['-d']:
result = rle_decompression(read_file(argument['<input>']))
print(result)
if argument['-c']:
result = rle_compression(read_file(argument['<input>']))
print(result)
else:
raise TypeError("choose a type between lz and rle")

1
bac1/q1/01dec/test.Ltxt Normal file

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 256 KiB

View File

Before

Width:  |  Height:  |  Size: 321 KiB

After

Width:  |  Height:  |  Size: 321 KiB

View File

Before

Width:  |  Height:  |  Size: 261 KiB

After

Width:  |  Height:  |  Size: 261 KiB

View File

Before

Width:  |  Height:  |  Size: 790 KiB

After

Width:  |  Height:  |  Size: 790 KiB

View File

Before

Width:  |  Height:  |  Size: 727 KiB

After

Width:  |  Height:  |  Size: 727 KiB

View File

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 161 KiB

View File

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 172 KiB

View File

@ -0,0 +1,27 @@
def plus_grand_bord(w):
for k, v in enumerate(w[1:]):
if v == w[0]:
if w[k+1:] == w[:len(w[k+1:])]:
return w[k+1:]
return None
def intersection(v, w):
max_inter = ''
for (k, v) in enumerate(v):
if v in w:
i = 1
while v[k:k+i] in w:
i += 1
if i >= len(w):
break
if len(v[k:k+i]) > len(max_inter):
max_inter = v[k:k+i]
return max_inter
def palyndrome(mot):
inv = [mot[len(mot)-1-i] for i in range(len(mot))]
return inv
if __name__ == "__main__":
print(palyndrome('anticonstitutionnelement'))

BIN
bac1/q1/15dec/serie12.pdf Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
tab = map(int, input().split)
def nombre_tasse(tab):
"""count the ammount of tasse following weird set of rules """
start_cup = 0
in_cup = False
for k, v in enumerate(tab):
if v < tab[k+1]:
in_cup = True
start_cup = k
elif v < tab[k-1]:
if
return count
print(nombre_tasse(tab))

View File

@ -0,0 +1,68 @@
from datetime import datetime
class Member:
"""Represente un membre dans la base de donnee de l'umons """
def __init__(self, name, surname, faculty, section, register_date = datetime.now().strftime("%Y%m%d"), seen = 0, seen_dates = list()):
"""TODO: to be defined.
:seen: number of time he came to CPUMONS
:seen_dates: date when he came
"""
self._name = name
self._surname = surname
self._mail = f"{name}.{surname}@studen.umons.ac.be"
self._faculty = faculty
self._section = section
self._register_date = register_date
self._seen = seen
self._seen_dates = seen_dates
def __str__(self):
return f"{self._name} {self._surname}, {self._faculty} -> {self._section}; seen {self._seen} time(s)"
def addSeen(self, date = datetime.now().strftime("%Y%m%d")):
self._seen += 1
self._seen_dates.append(date)
def interaction_menu(mbr_list):
print("""
1) Insert new member
2) List members
3) Delete a member
4) Update member
5) Quit
""")
try:
menu_selection = int(input("select your action: "))
except:
return True
if menu_selection == 1: # Insert new member
name, surname, faculty, section = input("enter: <name surname faculty section> (with space between each input): ").split(' ')
mbr_list.append(Member(name, surname, faculty, section))
elif menu_selection == 2: # List members
for k, v in enumerate(mbr_list):
print(k, v)
elif menu_selection == 3: # Delete a member
toDelUser = input("enter the index of the user you want to delete: ")
mbr_list.pop(toDelUser)
elif menu_selection == 4: # Update member
toUpdateUser = int(input("enter the index of the user you want to update: "))
datetime = input("enter the date where he has been seen ( let blank for the current date ): ")
if not datetime:
mbr_list[toUpdateUser].addSeen()
else:
mbr_list[toUpdateUser].addSeen(datetime)
else: # Menu error/quit
return False
return True
if __name__ == "__main__":
user_list = list()
exit = False
while not exit:
exit = not interaction_menu(user_list)

View File

@ -0,0 +1,14 @@
def diff(in1: str, in2: str) -> list:
ret = list()
for k, v in enumerate(in1):
if in2[k] != v :
ret.append((k, v, in2[k]))
return ret
if __name__ == "__main__":
in1, in2 = input("entrez la phrase 1:") , input("entrez la phrase 2")
diff_ins = diff(in1, in2)
if len(diff_ins) == 0:
print("Phrases identiques")
else:
print(diff_ins)

8
bac1/q2/algo/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

9
bac1/q2/algo/.idea/algo.iml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

7
bac1/q2/algo/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="20" project-jdk-type="JavaSDK" />
</project>

8
bac1/q2/algo/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/algo.iml" filepath="$PROJECT_DIR$/.idea/algo.iml" />
</modules>
</component>
</project>

6
bac1/q2/algo/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,27 @@
public class Couple {
private int q;
private int r;
public Couple(int q, int r) {
this.q = q;
this.r = r;
}
public void setQ(int q) {
this.q = q;
}
public int getQ() {
return q;
}
public void setR(int r) {
this.r = r;
}
public int getR() {
return r;
}
}

View File

@ -0,0 +1,11 @@
public class Division {
public static void main(String[] args) {
Couple test = Division(5, 3);
System.out.println(test.getQ() + ": " + test.getR());
}
public static Couple Division(int a, int b){
return new Couple(a/b, a%b);
}
}

View File

@ -0,0 +1,8 @@
public class test {
public String testM(){
return "yay";
}
public static void main(String[] args) {
System.out.println(testM());
}
}

View File

@ -0,0 +1,21 @@
public class Question {
private String text;
private String response;
private String user_input;
public Question(text, response){
this.text = text;
this.response = response;
}
public void Poser(){
Scanner resp = new Scanner(System.in);
System.out.println(text + ": ")
user_input = resp.nextLine();
}
public boolean Verifier(){
return user_input == response;
}
}

View File

@ -0,0 +1,18 @@
public class Questionnaire {
private Question[] questions;
public void add_question;
public void poser_tout(){
for(Question q: questions){
q.Poser();
if(q.Verifier())
System.out.println("Bravo");
else
System.out.println("Pas ouf");
}
}
}

View File

@ -0,0 +1,4 @@
public class TestsQuestionnaire {
public static void main(String[] args) {
}
}

49
bac1/q2/algo/hashmap.java Normal file
View File

@ -0,0 +1,49 @@
public class hashmap implements Map{
public static final TAB_SIZE = 1024;
LinkedList[] values = new Object[TAB_SIZE];
class HashEntry{ public Object key, values;
public HashEntry(Object key, Object value){
this.key = key;
this.value = value;
}
}
public void put(Object key, Object value){
int pos = key.hashCode() % values.lenght();
if (values[pos] == null){
values[pos] = value;
return;
}
if(value[pos] instanceof ArrayList<HashEntry> t){
t.add(new HashEntry(key, value));
return;
}
Object temp = values[pos];
values[pos] = new ArrayList<HashEntry>;
value[pos].add(temp);
value[pos].add(new HashEntry(key, value));
}
public Object get(Object key){
int pos = key.hashCode() % values.lenght();
if(values[pos].equals(key)){
return values[pos].value;
}
if(values[pos] instanceof ArrayList<HashEntry> t){
for (v : t) {
if (v.key.equals(key)){
return v.value
}
}
}
return null;
}
public static void main(String[] args) {
System.out.println("test");
}
}

8
bac1/q2/algo/hashmap/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

9
bac1/q2/algo/hashmap/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="20" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
bac1/q2/algo/hashmap/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/hashmap.iml" filepath="$PROJECT_DIR$/hashmap.iml" />
</modules>
</component>
</project>

6
bac1/q2/algo/hashmap/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

Some files were not shown because too many files have changed in this diff Show More