-
(5 поени) Имплементирајте thread
Reader
кој во позадина ќе ја вчита содржината на текстуална датотека проследена преку својствотоmatrixFile
. Кодот за вчитување на матрицата е даден во методотrun()
. Потребно е да го дополните овој код за да може да се вчитаат матриците, при што типот наin
променливата треба да го овозможува методотreadLine()
. -
(5 поени) Дополнете ја
Writer
класата така што таа ќе се однесува како thread и во позадина ќе ги запише вредностите на елементите од матрицатаmatrix
во датотекатаoutputPath
по еден елемент во секоја линија од фајлот.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================================= | |
između je nema da svetu vraću | |
Tomi limnija ljubi za nju dže | |
Nemoj da me za nju dže | |
Drže nemam čekanja, netvod sada klej | |
Klej Sapkowski, netvod sada klej | |
Ako je nema na dar | |
Bez tebe, neko je nema da me živu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================================= | |
lyric:????????? | |
Chorus | |
Oh, we're not gonna take it | |
No, we ain't gonna take it | |
We're gonna take it everywhere | |
Bought it at the drop of a hat | |
Nowadays we rap a lot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mk.ukim.finki.os.ispitni.syncHelperMethods; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* This class should be extended in order to preserve the state of the executing | |
* scenario | |
* | |
* @author ristes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mk.ukim.finki.os.av6.threadPool; | |
import java.net.Socket; | |
import static mk.ukim.finki.os.av6.threadPool.TCPServer.workerPool; | |
public class ServerWorker extends Thread { | |
private Socket clientSocket; | |
private Integer clientID; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mk.ukim.finki.os.lab3; | |
//public class BarberShopFifthWakes { | |
//} | |
import java.util.HashSet; | |
import java.util.concurrent.Semaphore; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReentrantLock; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mk.ukim.finki.os.lab3; | |
import java.util.Random; | |
import java.util.concurrent.Semaphore; | |
public class DiningPhilosophersTest { | |
public static void main(String args[]) throws InterruptedException { | |
DiningPhilosophers.runTest(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mk.ukim.finki.os.lab3; | |
import java.util.HashSet; | |
import java.util.concurrent.Semaphore; | |
public class Singleton { | |
static int initCounter = 0; | |
private static volatile Singleton singleton; | |
private static Semaphore initalPresence = new Semaphore(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mk.ukim.finki.os.lab1; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Arrays; | |
public class Problem4 { | |
public static final String filePath = "/home/aleksandar/Desktop/tmp/lab1.problem4"; | |
//Interval za golemina na fajl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def identity(nums): | |
"""Identity: | |
Given a list of numbers, write a list comprehension that produces a copy of the list. | |
>>> identity([1, 2, 3, 4, 5]) | |
[1, 2, 3, 4, 5] | |
>>> identity([]) | |
[] | |
""" | |
return [number for number in nums] |