This file contains 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
// ====================== | |
// Prime factorization with flatMap | |
//====================== | |
// flatMap can be used as a way to add and remove items (modify the number of items) during a map. | |
// In other words, it allows you to map many items to many items (by handling each input item separately), rather than always one-to-one. | |
// it works like the opposite of filter. | |
var numbersTofactor = [20,1,17,2,3,15,16,100,157]; | |
var factors = numbersTofactor.flatMap((n) => { | |
var allFactors = []; |
This file contains 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
Then(`the downloaded PDF Document contains the following values:`, async (dataTable) => { | |
dataTable = await Utils.processDataTable(dataTable); | |
for(let i = 0; i < 5; i++) { | |
if(testData.pdfText !== undefined){ | |
break; | |
} | |
await Browser.sleep(500); | |
} | |
for(const line of dataTable) { | |
if(testData.pdfText.includes(line)) { |
This file contains 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
public class Hello { | |
public static void main(String[] args){ | |
Library library = new Library(); | |
new Thread(library).start(); | |
new Thread(new Renter(library,"Mike")).start(); | |
new Thread(new Renter(library,"Max")).start(); | |
new Thread(new Renter(library,"Priebe")).start(); |