Skip to content

Commit 3b326c9

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 34ae894 + 49b0bbf commit 3b326c9

File tree

6 files changed

+33
-31
lines changed

6 files changed

+33
-31
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
Текстуално читање, бинарно запишување
22
===========================
3-
Потребно е да исчитате csv датотека, и да ја запишете во бинарна датотека. Елементите од csv датотеката се реден
4-
број 4 карактери, вредност 8 ASCII карактери и статус 1 ASCII карактер:
3+
Потребно е да исчитате `csv` датотека и да ја запишете во бинарна датотека. Елементите од `csv` датотеката се реден
4+
број (4 карактери), вредност (8 ASCII карактери) и статус (1 ASCII карактер):
55

6-
0001, 87895432, T
6+
0001, 87895432, T
77

8-
0802, 51920654, F
8+
0802, 51920654, F
99

10-
6521, 77142754, T
10+
6521, 77142754, T
1111

12-
3215, 97142097, T
12+
3215, 97142097, T
1313

1414

1515
При исчитувањето потребно е да го запазите сортирањето во бинарната датотека – сортирање во растечки редослед
16-
по вредноста на редниот број. Затоа, потребно е секој исчитан ред од csv датотеката да го запишете во бинарната
16+
по вредноста на редниот број. Затоа, потребно е секој исчитан ред од `csv` датотеката да го запишете во бинарната
1717
датотека на позиција одредена според редниот број: реден број 0001 – позиција 1, реден број 0802 – позиција 802,
18-
реден број 6521 – позиција 6521… Го запишувате повторно целиот ред (бинарно) - поле по поле без никакви сепаратори.
18+
реден број 6521 – позиција 6521… Го запишувате повторно целиот ред (бинарно) - поле по поле, без никакви сепаратори.
1919

20-
Напишете го методот 'parseCsv(String csvFile, String binFile)', каде двата стринга се патека до соодветните датотеки.
20+
Напишете го методот `public void parseCsv(String csvFile, String binFile)`, каде двата стринга се патека до соодветните датотеки.

java-io/src/main/java/mk/ukim/finki/os/examples/charcount/problem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Char counting problem
1+
Char Counting Problem
22
--
33

44
*@author: Pance Ribarski*
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
Со користење на Java I/O да се имплементираат следните методи од класата ExamIO:
1+
Java I/O
2+
--
23

3-
(10 поени)void copyLargeTxtFiles(String from, String to, long size)
4+
Со користење на Java I/O да се имплементираат следните методи од класата ExamIO:
45

5-
Ги копира сите датотеки со екстензија .txt од именикот зададен преку from аргументот, во именикот зададен преку to аргументот, кои се поголеми од вредноста на size аргументот (во бајти). Доколку не постои именикот from да се испише "Ne postoi", a aко не постои именикот to, потребно е да се креира.
6-
(10 поени)void serializeData(String destination, List<byte[]> data)
6+
a) (10 поени) `void copyLargeTxtFiles(String from, String to, long size)`
7+
- Ги копира сите датотеки со екстензија `.txt` од именикот зададен преку `from` аргументот, во именикот зададен преку `to` аргументот, кои се поголеми од вредноста на `size` аргументот (во бајти). Доколку не постои именикот `from` да се испише `"Ne postoi"`, a aко не постои именикот `to`, потребно е да се креира.
78

8-
Низата од податоци зададени со data ја запишува во датотеката destination, без никакви делимитери (како континуиран тек од бајти). Сите елементи на листата data имаат иста должина (ист број бајти).
9-
(Бонус 5 поени)byte[] deserializeDataAtPosition(String source, long position, long elementLength)
9+
b) (10 поени) `void serializeData(String destination, List<byte[]> data)`
10+
- Низата од податоци зададени со `data` ја запишува во датотеката `destination`, без никакви делимитери (како континуиран тек од бајти). Сите елементи на листата `data` имаат иста должина (ист број бајти).
1011

11-
Го исчитува и враќа податокот на позицијата position од датотеката source, која содржи голем број податоци, сите со иста должина во бајти, без никаков делимитер. Секој од податоците има должина зададена со elementLength. При имплементацијата да не се чита содржината на целата датотека.
12+
c) (Бонус 5 поени) `byte[] deserializeDataAtPosition(String source, long position, long elementLength)`
13+
- Го исчитува и враќа податокот на позицијата `position` од датотеката `source`, која содржи голем број податоци, сите со иста должина во бајти, без никаков делимитер. Секој од податоците има должина зададена со `elementLength`. При имплементацијата да не се чита содржината на целата датотека.

java-io/src/main/java/mk/ukim/finki/os/examples/ls_mv_cp/problem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ List Move and Copy Problem
99

1010
Внимавајте на следните работи:
1111

12-
- доколку директориумот претставен преку `in` не постои, излезете од методот со пораката "prazno" на екран
12+
- доколку директориумот претставен преку `in` не постои, излезете од методот со пораката `"prazno"` на екран
1313
- доколку директориумот претставен преку `out` не постои, потребно е да го креирате
1414
- доколку директориумот претставен преку `out` постои, потребно е да ја избришете неговата содржина
1515
- претпоставете дека нема директориуми во неговата содржина

synchronization/src/main/java/mk/ukim/finki/os/synchronization/exam18/kol1/g1/README.en.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ Matrix multiplication
22
===
33

44
1. **(5 points)** Implement the thread `Reader` that will read the content of the file provided as the property
5-
`matrixFile` in background. The code for matrix reading is given in the `run()` method. You need to complete this code and
5+
`matrixFile`, in the background. The code for matrix reading is given in the `run()` method. You need to complete this code and
66
provide a variable `in` that will have the `readLine()` method for reading the content of the file.
77

8-
2. **(5 points)** Complete the `Writer` class such that it will behave as thread and will write in background the element
9-
values of `matrix` into the file `outputPath`, one element per line.
8+
2. **(5 points)** Complete the `Writer` class so that it will behave as a thread and will write the element values of `matrix`
9+
into the file `outputPath`, in the background, one element per line.
1010

11-
3. **(5 points)** Complete the `Transformer` class such that it will behave as thread and will compute the result in
12-
background. It is not allowed more that 15 parallel executions of the given code in the `run()` method.
11+
3. **(5 points)** Complete the `Transformer` class such that it will behave as a thread and will compute the result in
12+
the background. It is not allowed to have more than 15 parallel executions of the given code in the `run()` method.
1313

14-
4. **(10 points)** Implement the class `FileScanner` that will behave as a *thread*. This class should recursively scan
15-
the directory given in the property `directoryToScan` and should find all the files with extension `.mat`. If the directory
16-
`directoryToScan` does not exist, you should provide appropriate message. The recursive scanning should be executed
14+
4. **(10 points)** Implement the class `FileScanner` that will behave as a thread. This class should recursively scan
15+
the directory designated by `directoryToScan` and should find all files with the `.mat` extension. If the directory
16+
`directoryToScan` does not exist, you should provide an appropriate message. The recursive scanning should be executed
1717
in separate thread instances of the class `FileScanner`. At the end of the `directoryToScan` scanning, the `FileScanner`
18-
should waid the results form all `subDirectory` threads.
18+
should wait for the results form all `subDirectory` threads.
1919

20-
5. **(20 points)** Complete the `MainG1.main` method according to `//todo:` comments.
20+
5. **(20 points)** Complete the `MainG1.main` method according to the `//todo:` comments.
2121

2222
6. **(5 points)** Ensure mutual exclusion for all critical regions.
2323

24-
The starter code that contains all previously mentioned classes is the follows:
24+
The starter code that contains all previously mentioned classes is the following:
2525

2626
```java
2727
import java.io.File;
@@ -46,7 +46,7 @@ class Reader extends Thread {
4646
// todo: complete this method according to the text description
4747

4848
try {
49-
// todo: The variable in should provide the readLine() method
49+
// todo: The variable s should provide the readLine() method
5050
int n = Integer.parseInt(s.readLine().trim());
5151
this.matrix = new int[n][n];
5252

synchronization/src/main/java/mk/ukim/finki/os/synchronization/exam18/kol1/g1/Solution.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static class Reader extends Thread {
6868
@Override
6969
public void run() {
7070
// todo: complete this method according to the text description
71-
// todo: The variable in should provide the readLine() method
71+
// todo: The variable s should provide the readLine() method
7272
try (BufferedReader s = new BufferedReader(new FileReader(new File(matrixFile)))) {
7373

7474
int n = Integer.parseInt(s.readLine().trim());

0 commit comments

Comments
 (0)