lauraa169 commited on
Commit
e221ec1
·
verified ·
1 Parent(s): a15f0bd

Upload dataset_base.jsonl with huggingface_hub

Browse files
Files changed (1) hide show
  1. dataset_base.jsonl +76 -29
dataset_base.jsonl CHANGED
@@ -1,64 +1,111 @@
1
  {"id":"base_java_01","dataset_type":"base","language":"Java","task_category":"scaffolding",
2
  "prompt_en":"write a method createScaffold in java that creates a basic project structure for maven. Don't include imports",
3
  "prompt_nl":"schrijf een method createScaffold in java die een basisprojectstructuur voor maven creëert. Voeg geen imports toe.",
4
- "code_snippet_input":"import java.nio.file.*;\nimport java.io.IOException;\n\npublic static void createScaffold() throws IOException {\n // TODO: Create the directories here\n}",
5
- "canonical_solution":"public static void createScaffold() throws IOException {\n Files.createDirectories(Paths.get(\"src/main/java/com/example/demo\"));\n Files.createDirectories(Paths.get(\"src/test/java/com/example/demo\"));\n}",
6
  "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.AfterEach;\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.*;\nimport java.util.Comparator;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class ScaffoldTest {\n\n\n @AfterEach\n void tearDown() throws IOException {\n Path root = Paths.get(\"src\");\n if (Files.exists(root)) {\n Files.walk(root)\n .sorted(Comparator.reverseOrder())\n .map(Path::toFile)\n .forEach(File::delete);\n }\n }\n",
7
- "unit_test_assertion":"@Test\n public void testDirectoryCreation() throws IOException {\n createScaffold();\n\nassertTrue(Files.exists(Paths.get(\"src/main/java/com/example/demo\")), \"Main directory should be created\");\n assertTrue(Files.exists(Paths.get(\"src/test/java/com/example/demo\")), \"Test directory should be created\");\n }\n}"
 
8
  }
9
  {"id":"base_java_02","dataset_type":"base","language":"Java","task_category":"elem_func",
10
- "prompt_en":"make a staff class with constructor setters and getters with at least name, birthdate, gender, position, salary, hire date, and department. Don't include imports",
11
- "prompt_nl":"maak een staff class met constructor setters en getters met ten minste name, birthdate, gender, position, salary, hire date en department. Voeg geen imports toe.",
12
  "code_snippet_input":"",
13
  "canonical_solution":"public class Staff {\n private String name;\n private java.time.LocalDate birthDate;\n private String gender;\n private String position;\n private double salary;\n private java.time.LocalDate hireDate;\n private String department;\n\n public Staff(String name, java.time.LocalDate birthDate, String gender, String position, double salary, java.time.LocalDate hireDate, String department) {\n this.name = name;\n this.birthDate = birthDate;\n this.gender = gender;\n this.position = position;\n this.salary = salary;\n this.hireDate = hireDate;\n this.department = department;\n }\n // ... Getters and Setters omitted for brevity in this view, but include them in real JSON ...\n}",
14
  "unit_test_setup":"import org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport java.time.LocalDate;\nimport java.time.Period;\nimport static org.junit.jupiter.api.Assertions.*;",
15
- "unit_test_assertion":"\nclass StaffTest {\n private Staff staff;\n private final LocalDate birthDate = LocalDate.of(1990, 5, 20);\n private final LocalDate hireDate = LocalDate.of(2015, 1, 10);\n\n @BeforeEach\n void setUp() {\n staff = new Staff(\"Alice Johnson\", birthDate, \"Female\", \"Data Scientist\", 75000.00, hireDate, \"R&D\");\n }\n\n @Test\n void testConstructorAndGetters() {\n assertEquals(\"Alice Johnson\", staff.getName());\n }\n // ... other tests ...\n}"
 
16
  }
17
- {"id":"base_java_03","dataset_type":"base","language":"Java","task_category":"id_bug",
18
  "prompt_en":"why am I getting a compilation error in this code? fix it and don't include imports",
19
  "prompt_nl":"waarom krijg ik een compilatie error in deze code? Los het op en voeg geen imports toe.",
20
- "code_snippet_input":"List<String> results = new ArrayList<>();\nint counter = 0;\nList<String> names = List.of(\"Alice\", \"Bob\", \"Charlie\");\n\nnames.forEach(name -> {\n counter++;\n results.add(counter + \": \" + name);\n});",
21
  "canonical_solution":"List<String> results = new ArrayList<>();\nAtomicInteger counter = new AtomicInteger(0);\nList<String> names = List.of(\"Alice\", \"Bob\", \"Charlie\");\n\nnames.forEach(name -> {\n results.add(counter.incrementAndGet() + \": \" + name);\n});",
22
- "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport static org.junit.jupiter.api.Assertions.*;\n\nclass LambdaTest {\n // We open the method here, but we do NOT define 'names' yet,\n // because the student's code snippet defines 'names'.\n private List<String> generateResults() {",
23
- "unit_test_assertion":"return results;\n }\n\n @Test\n public void testCounterIncrements() {\n List<String> results = generateResults();\n\n assertEquals(3, results.size(), \"List should contain 3 elements\");\n assertTrue(results.get(0).startsWith(\"1:\"), \"First element must start with 1:\");\n assertTrue(results.get(1).startsWith(\"2:\"), \"Second element must start with 2:\");\n assertTrue(results.get(2).startsWith(\"3:\"), \"Third element must start with 3:\");\n }\n}"
 
24
  }
25
- {"id":"base_java_04","dataset_type":"base","language":"Java","task_category":"id_bug",
26
  "prompt_en":"why am I getting a compilation error in this code? fix it and don't include imports",
27
  "prompt_nl":"waarom krijg ik een compilatie error in deze code? Los het op en voeg geen imports toe.",
28
- "code_snippet_input":"name clash: method(List<String>) has the same erasure as method(List<Integer>)\n\npublic void sort(List<String> data) {\nreturn \"Sorting strings\";\n}\npublic String sort(List<Integer> data) { \nreturn \"Sortig integers\";",
29
- "canonical_solution":"public String sortStrings(List<String> data) {\nreturn \"Sorting strings\";\n}\npublic String sortIntegers(List<Integer> data) { \nreturn \"Sortig integers\";\n}\n}",
30
  "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport java.util.List;\nimport java.util.ArrayList;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class Solution {\n",
31
- "unit_test_assertion":"@Test\n public void testMethodsAreDistinct() {\n String result1 = sortStrings(new ArrayList<String>());\n String result2 = sortNumbers(new ArrayList<Integer>());\n \n assertEquals(\"Sorting strings\", result1);\n assertEquals(\"Sorting integers\", result2);\n }\n}"
 
32
  }
33
- {"id":"base_java_05","dataset_type":"base","language":"Java","task_category":"id_bug",
34
  "prompt_en":"why am I getting a compilation error in this code? I want to use the process from printer. Output only the fixed class.",
35
- "prompt_nl":"De volgende class compileert niet omdat beide interfaces dezelfde default methode definiëren. Herstel de compilatiefout in de 'OfficeMachine' class door de methode te overschrijven en expliciet de implementatie van 'Printer' te gebruiken. Geef ALLEEN de gecorrigeerde class.",
36
- "code_snippet_input":" class OfficeMachine inherits unrelated defaults for process() from types Printer and Scanner\n\npublic class OfficeMachine implements Printer, Scanner {\n // The class body is empty, causing the ambiguity error\n}",
37
  "canonical_solution":"public class OfficeMachine implements Printer, Scanner {\n @Override\n public String process() {\n return Printer.super.process();\n }\n}",
38
  "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\ninterface Printer {\n default String process() { return \"Printing document...\"; }\n}\n\ninterface Scanner {\n default String process() { return \"Scanning document...\"; }\n}\n",
39
- "unit_test_assertion":"\nclass DiamondProblemTest {\n @Test\n public void testConflictResolution() {\n OfficeMachine machine = new OfficeMachine();\nassertEquals(\"Printing document...\", machine.process(), \"Should return Printer's output\");\n }\n}"
 
40
  }
41
- {"id":"base_java_06","dataset_type":"base","language":"Java","task_category":"fix_bug",
42
  "prompt_en":"why am i getting wrong results in this code? The method doesn't return a list of the transaction in the target currency. Fix the method and don't include imports",
43
  "prompt_nl":"Waarom krijg ik verkeerde resultaten in deze code? De methode retourneert geen lijst met transacties in de doelvaluta. Corrigeer de methode en neem geen imports op.",
44
  "code_snippet_input":"public class DataFilter {\npublic List<Transaction> filterByCurrency(List<Transaction> data, String targetCurrency) {\nList<Transaction> result = new ArrayList<>();\nfor (Transaction t : data) {\nif (t.getCurrency() == targetCurrency) {\nresult.add(t);\n}\n}\nreturn result;\n}",
45
  "canonical_solution":"public class DataFilter {\npublic List<Transaction> filterByCurrency(List<Transaction> data, String targetCurrency) {\nList<Transaction> result = new ArrayList<>();\nfor (Transaction t : data) {\nif (targetCurrency.equals(t.getCurrency())) {\nresult.add(t);\n}\n}\nreturn result;\n}\n}",
46
  "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport java.util.List;\nimport java.util.ArrayList;\nimport static org.junit.jupiter.api.Assertions.*;\n\nclass Transaction {\n private String id;\n private String currency;\n public Transaction(String id, String currency) { this.id = id; this.currency = currency; }\n public String getCurrency() { return currency; }\n}\n",
47
- "unit_test_assertion": "\nclass DataFilterTest {\n @Test\n public void testCurrencyFiltering() {\n DataFilter filter = new DataFilter();\n List<Transaction> dataset = new ArrayList<>();\n\n String dynamicUSD = new String(\"USD\");\n String dynamicEUR = new String(\"EUR\");\n \n dataset.add(new Transaction(\"tx1\", dynamicUSD));\n dataset.add(new Transaction(\"tx2\", dynamicEUR));\n dataset.add(new Transaction(\"tx3\", dynamicUSD));\n \n List<Transaction> result = filter.filterByCurrency(dataset, \"USD\");\n \n assertEquals(2, result.size(), \"Should find 2 USD transactions even if memory addresses differ\");\n }\n}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
- {"id":"base_java_07","dataset_type":"base","language":"Java","task_category":"fix_bug","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
50
- {"id":"base_java_08","dataset_type":"base","language":"Java","task_category":"fix_bug","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
51
- {"id":"base_java_09","dataset_type":"base","language":"Java","task_category":"architecture","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
52
  {"id":"base_java_10","dataset_type":"base","language":"Java","task_category":"refactoring",
53
  "prompt_en":"transform this function so it uses datetime objects where the deadline is at the start of the day, while still being compatible with the inputs of the software",
54
  "prompt_nl":"transformeer deze functie zodat deze datetime objecten gebruikt waarbij de deadline aan het begin van de dag ligt, terwijl deze nog steeds compatibel is met de inputs van de software.",
55
  "code_snippet_input":"public static boolean isOverdue(LocalDate deadline) {\n LocalDate today = LocalDate.now();\n return today.isAfter(deadline);\n}",
56
  "canonical_solution":"public static boolean isOverdue(LocalDate deadlineDate) {\n LocalDateTime currentDateTime = LocalDateTime.now();\n LocalDateTime deadlineTimestamp = deadlineDate.atStartOfDay();\n return currentDateTime.isAfter(deadlineTimestamp);\n}",
57
  "unit_test_setup":"import java.time.LocalDate;\nimport java.time.LocalDateTime;\nimport org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class DateTest {\n\n",
58
- "unit_test_assertion":"@Test\n public void testYesterdayIsOverdue() {\nassertTrue(isOverdue(LocalDate.now().minusDays(1)), \"Yesterday should be overdue\");\n }\n\n @Test\n public void testTomorrowIsNotOverdue() {\n assertFalse(isOverdue(LocalDate.now().plusDays(1)), \"Tomorrow should not be overdue\");\n }\n\n @Test\n public void testTodayIsOverdue() {\nassertTrue(isOverdue(LocalDate.now()), \"Today (current time) should be considered after Today (start of day)\");\n }\n}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
60
- {"id":"base_java_11","dataset_type":"base","language":"Java","task_category":"refactoring","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
61
- {"id":"base_java_12","dataset_type":"base","language":"Java","task_category":"refactoring","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
62
 
63
  {"id":"base_javascript_01","dataset_type":"base","language":"JavaScript","task_category":"scaffolding","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
64
  {"id":"base_javascript_02","dataset_type":"base","language":"JavaScript","task_category":"elem_func","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
@@ -93,10 +140,10 @@
93
  {"id":"base_python_15","dataset_type":"base","language":"Python","task_category":"refactoring","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
94
 
95
  {"id":"base_sql_01","dataset_type":"base","language":"SQL","task_category":"queries",
96
- "prompt_en":"I am calculating and retrieving data for a tableau chart using an MSSQL query. Above the chart is AGG (average number of customer hours cost center), which is SUM([Direct Time In Hours])/[numberofclients].[Sum unique clients cost center]. Sum unique clients cost center is in Tableau with the following calculation: SUM({FIXED [Year], [Month], [Cost Center Name]: COUNTD([Client])}) This comes from the numberofclients table. Can you convert this to an MSSQL database query? If you are missing any calculations, please ask for them first before creating entire queries.",
97
- "prompt_nl":"Ik ben bezig om een tableau grafiek de data te berekenen en op te halen doormiddel van een mssql query. boven de grafiek staat AGG(gemiddeld aantal klanturen kostenplaats) dat is SUM([Directe Tijd In Uren])/[numberofclients].[Sum unieke clienten kostenplaats]. Sum unieke clienten kostenplaats zit in tableau de volgende berekening: SUM({FIXED [Jaar], [Maand], [Kostenplaats Naam]: COUNTD([Client])}) dit komt uit de tabel numberofclients. kan je dit omzetten naar een mssql database query mocht je berekeningen missen, vraag deze dan eerst voordat je hele qeurys gaat maken.",
98
  "code_snippet_input":"",
99
- "canonical_solution":"",
100
  "unit_test_setup":"",
101
  "unit_test_assertion":""
102
  }
 
1
  {"id":"base_java_01","dataset_type":"base","language":"Java","task_category":"scaffolding",
2
  "prompt_en":"write a method createScaffold in java that creates a basic project structure for maven. Don't include imports",
3
  "prompt_nl":"schrijf een method createScaffold in java die een basisprojectstructuur voor maven creëert. Voeg geen imports toe.",
4
+ "code_snippet_input":"",
5
+ "canonical_solution":"public static void createScaffold() throws IOException {\n Files.createDirectories(Paths.get(\"src/main/java/\"));\n Files.createDirectories(Paths.get(\"src/test/java/\"));\n}",
6
  "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.AfterEach;\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.*;\nimport java.util.Comparator;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class ScaffoldTest {\n\n\n @AfterEach\n void tearDown() throws IOException {\n Path root = Paths.get(\"src\");\n if (Files.exists(root)) {\n Files.walk(root)\n .sorted(Comparator.reverseOrder())\n .map(Path::toFile)\n .forEach(File::delete);\n }\n }\n",
7
+ "unit_test_assertion":"@Test\n public void testDirectoryCreation() throws IOException {\n createScaffold();\n\nassertTrue(Files.exists(Paths.get(\"src/main/java/\")), \"Main directory should be created\");\n assertTrue(Files.exists(Paths.get(\"src/test/java/\")), \"Test directory should be created\");\n }\n}",
8
+ "comment":"the folder structure should contain AT LEAST src/main/java/ and src/test/java/ directories since they're required for every maven project"
9
  }
10
  {"id":"base_java_02","dataset_type":"base","language":"Java","task_category":"elem_func",
11
+ "prompt_en":"make a staff class with constructor, setters and getters with at least name, birthdate, gender, position, salary, hire date, and department. Don't include imports",
12
+ "prompt_nl":"maak een staff class met constructor, setters en getters met ten minste name, birthdate, gender, position, salary, hire date en department. Voeg geen imports toe.",
13
  "code_snippet_input":"",
14
  "canonical_solution":"public class Staff {\n private String name;\n private java.time.LocalDate birthDate;\n private String gender;\n private String position;\n private double salary;\n private java.time.LocalDate hireDate;\n private String department;\n\n public Staff(String name, java.time.LocalDate birthDate, String gender, String position, double salary, java.time.LocalDate hireDate, String department) {\n this.name = name;\n this.birthDate = birthDate;\n this.gender = gender;\n this.position = position;\n this.salary = salary;\n this.hireDate = hireDate;\n this.department = department;\n }\n // ... Getters and Setters omitted for brevity in this view, but include them in real JSON ...\n}",
15
  "unit_test_setup":"import org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport java.time.LocalDate;\nimport java.time.Period;\nimport static org.junit.jupiter.api.Assertions.*;",
16
+ "unit_test_assertion":"\nclass StaffTest {\n private Staff staff;\n private final LocalDate birthDate = LocalDate.of(1990, 5, 20);\n private final LocalDate hireDate = LocalDate.of(2015, 1, 10);\n\n @BeforeEach\n void setUp() {\n staff = new Staff(\"Alice Johnson\", birthDate, \"Female\", \"Data Scientist\", 75000.00, hireDate, \"R&D\");\n }\n\n @Test\n void testConstructorAndGetters() {\n assertEquals(\"Alice Johnson\", staff.getName());\n }\n // ... other tests ...\n}",
17
+ "comment":"include a constructor, getters and setters for AT LEAST all the fields in the Staff class that are specified in the prompt (name, birthdate, gender, position, salary, hire date, and department)."
18
  }
19
+ {"id":"base_java_03","dataset_type":"base","language":"Java","task_category":"fix_bug",
20
  "prompt_en":"why am I getting a compilation error in this code? fix it and don't include imports",
21
  "prompt_nl":"waarom krijg ik een compilatie error in deze code? Los het op en voeg geen imports toe.",
22
+ "code_snippet_input":"/*Local variable counter defined in an enclosing scope must be final or effectively final*/ \nList<String> results = new ArrayList<>();\nint counter = 0;\nList<String> names = List.of(\"Alice\", \"Bob\", \"Charlie\");\n\nnames.forEach(name -> {\n counter++;\n results.add(counter + \": \" + name);\n});",
23
  "canonical_solution":"List<String> results = new ArrayList<>();\nAtomicInteger counter = new AtomicInteger(0);\nList<String> names = List.of(\"Alice\", \"Bob\", \"Charlie\");\n\nnames.forEach(name -> {\n results.add(counter.incrementAndGet() + \": \" + name);\n});",
24
+ "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport static org.junit.jupiter.api.Assertions.*;\n\nclass LambdaTest {\n private List<String> generateResults() {",
25
+ "unit_test_assertion":"return results;\n }\n\n @Test\n public void testCounterIncrements() {\n List<String> results = generateResults();\n\n assertEquals(3, results.size(), \"List should contain 3 elements\");\n assertTrue(results.get(0).startsWith(\"1:\"), \"First element must start with 1:\");\n assertTrue(results.get(1).startsWith(\"2:\"), \"Second element must start with 2:\");\n assertTrue(results.get(2).startsWith(\"3:\"), \"Third element must start with 3:\");\n }\n}",
26
+ "comment":"counter variable is not final, and cant be changed within the lambda. MUST use an AtomicInteger instead to hold the counter, which allows us to modify its value within the lambda."
27
  }
28
+ {"id":"base_java_04","dataset_type":"base","language":"Java","task_category":"fix_bug",
29
  "prompt_en":"why am I getting a compilation error in this code? fix it and don't include imports",
30
  "prompt_nl":"waarom krijg ik een compilatie error in deze code? Los het op en voeg geen imports toe.",
31
+ "code_snippet_input":"/*name clash: method(List<String>) has the same erasure as method(List<Integer>)*/\npublic String sort(List<String> data) {\nreturn \"Sorting strings\";\n}\npublic String sort(List<Integer> data) { \nreturn \"Sorting integers\";",
32
+ "canonical_solution":"public String sortStrings(List<String> data) {\nreturn \"Sorting strings\";\n}\npublic String sortIntegers(List<Integer> data) { \nreturn \"Sorting integers\";\n}\n}",
33
  "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport java.util.List;\nimport java.util.ArrayList;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class Solution {\n",
34
+ "unit_test_assertion":"@Test\n public void testMethodsAreDistinct() {\n String result1 = sortStrings(new ArrayList<String>());\n String result2 = sortIntegers(new ArrayList<Integer>());\n \n assertEquals(\"Sorting strings\", result1);\n assertEquals(\"Sorting integers\", result2);\n }\n}",
35
+ "comment":"java compiles List<Integer> and List<String> to the same type List, so can't overload the method. SOlution MUST rename the methods to have distinct names."
36
  }
37
+ {"id":"base_java_05","dataset_type":"base","language":"Java","task_category":"fix_bug",
38
  "prompt_en":"why am I getting a compilation error in this code? I want to use the process from printer. Output only the fixed class.",
39
+ "prompt_nl":"de volgende klasse compileert niet omdat beide interfaces dezelfde default methode definiëren. Herstel de compilatiefout in de 'OfficeMachine' class door de methode te overschrijven en expliciet de implementatie van 'Printer' te gebruiken. Geef ALLEEN de gecorrigeerde class.",
40
+ "code_snippet_input":"/*class OfficeMachine inherits unrelated defaults for process() from types Printer and Scanner*/\npublic class OfficeMachine implements Printer, Scanner {\n \n}",
41
  "canonical_solution":"public class OfficeMachine implements Printer, Scanner {\n @Override\n public String process() {\n return Printer.super.process();\n }\n}",
42
  "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\ninterface Printer {\n default String process() { return \"Printing document...\"; }\n}\n\ninterface Scanner {\n default String process() { return \"Scanning document...\"; }\n}\n",
43
+ "unit_test_assertion":"\nclass DiamondProblemTest {\n @Test\n public void testConflictResolution() {\n OfficeMachine machine = new OfficeMachine();\nassertEquals(\"Printing document...\", machine.process(), \"Should return Printer's output\");\n }\n}",
44
+ "comment":"the error happens because officemachine implements two methods with the same name from different interfaces. the soluction MUST override the process() method to explicitly call the Printer's default method."
45
  }
46
+ {"id":"base_java_06","dataset_type":"base","language":"Java","task_category":"id_bug",
47
  "prompt_en":"why am i getting wrong results in this code? The method doesn't return a list of the transaction in the target currency. Fix the method and don't include imports",
48
  "prompt_nl":"Waarom krijg ik verkeerde resultaten in deze code? De methode retourneert geen lijst met transacties in de doelvaluta. Corrigeer de methode en neem geen imports op.",
49
  "code_snippet_input":"public class DataFilter {\npublic List<Transaction> filterByCurrency(List<Transaction> data, String targetCurrency) {\nList<Transaction> result = new ArrayList<>();\nfor (Transaction t : data) {\nif (t.getCurrency() == targetCurrency) {\nresult.add(t);\n}\n}\nreturn result;\n}",
50
  "canonical_solution":"public class DataFilter {\npublic List<Transaction> filterByCurrency(List<Transaction> data, String targetCurrency) {\nList<Transaction> result = new ArrayList<>();\nfor (Transaction t : data) {\nif (targetCurrency.equals(t.getCurrency())) {\nresult.add(t);\n}\n}\nreturn result;\n}\n}",
51
  "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport java.util.List;\nimport java.util.ArrayList;\nimport static org.junit.jupiter.api.Assertions.*;\n\nclass Transaction {\n private String id;\n private String currency;\n public Transaction(String id, String currency) { this.id = id; this.currency = currency; }\n public String getCurrency() { return currency; }\n}\n",
52
+ "unit_test_assertion": "\nclass DataFilterTest {\n @Test\n public void testCurrencyFiltering() {\n DataFilter filter = new DataFilter();\n List<Transaction> dataset = new ArrayList<>();\n\n String dynamicUSD = new String(\"USD\");\n String dynamicEUR = new String(\"EUR\");\n \n dataset.add(new Transaction(\"tx1\", dynamicUSD));\n dataset.add(new Transaction(\"tx2\", dynamicEUR));\n dataset.add(new Transaction(\"tx3\", dynamicUSD));\n \n List<Transaction> result = filter.filterByCurrency(dataset, \"USD\");\n \n assertEquals(2, result.size(), \"Should find 2 USD transactions even if memory addresses differ\");\n }\n}",
53
+ "comment":"== checks for the same reference in memory, not value equality. MUST use .equals() to compare the string values of the currencies."
54
+ }
55
+ {"id":"base_java_07","dataset_type":"base","language":"Java","task_category":"id_bug",
56
+ "prompt_en":"why doesn't this method read the csv data properly? Fix the method and don't include imports",
57
+ "prompt_nl":"Waarom leest deze methode de csv-gegevens niet correct? Repareer de methode en neem geen imports op.",
58
+ "code_snippet_input":"/* \nCSV DATA CONTEXT:\npatient_id,full_name,birth_date,is_active,last_bill_amount,department\n101,Laura Smith,2002-05-20,true,150.00,Cardiology\n...\n110,Sam I Am,1960-09-09,false,NA,Psychiatry\n*/\n\npublic static double getBillAmount(String csvLine) {\n String[] columns = csvLine.split(\",\");\n String rawAmount = columns[4];\n return Double.parseDouble(rawAmount);\n}",
59
+ "canonical_solution":"public static double getBillAmount(String csvLine) {\n String[] columns = csvLine.split(\",\");\n if (columns.length <= 4) return Double.NaN;\n \n String rawAmount = columns[4].trim();\n \n if (rawAmount.equalsIgnoreCase(\"NA\") || rawAmount.isEmpty()) {\n return Double.NaN;\n }\n \n try {\n return Double.parseDouble(rawAmount);\n } catch (NumberFormatException e) {\n return Double.NaN;\n }\n}",
60
+ "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class Solution {\n",
61
+ "unit_test_assertion":"@Test\n public void testValidAmount() {\n String line = \"101,Laura Smith,2002-05-20,true,150.00,Cardiology\";\n assertEquals(150.00, getBillAmount(line), 0.001);\n }\n\n @Test\n public void testNAValue() {\n String line = \"110,Sam I Am,1960-09-09,false,NA,Psychiatry\";\n assertTrue(Double.isNaN(getBillAmount(line)), \"NA should return NaN, not throw exception\");\n }\n\n @Test\n public void testGarbageValue() {\n String line = \"105,Big Mike,1978-06-30,0,FREE,Emergency\";\n assertTrue(Double.isNaN(getBillAmount(line)), \"Invalid text should return NaN\");\n }\n}",
62
+ "comment":"the method fails to handle 'NA' values and possible formatting issues. MUST check for 'NA' and handle NumberFormatException to avoid crashes."
63
+ }
64
+ {"id":"base_java_08","dataset_type":"base","language":"Java","task_category":"id_bug",
65
+ "prompt_en":"i want to use this method to transpose a square matrix but it gives the wrong results. Fix the method and don't include imports",
66
+ "prompt_nl":"Ik wil deze methode gebruiken om een vierkante matrix te transponeren, maar het geeft verkeerde resultaten. Corrigeer de methode en neem geen imports op.",
67
+ "code_snippet_input":"public static int[][] transposeMatrix(int[][] input) {\nint rows = input.length;\nint cols = input[0].length;\nint[][] output = new int[cols][rows];\nfor (int i = 0; i < rows; i++) {\nfor (int j = 0; j < cols; j++) {\noutput[i][j] = input[i][j]; \n}\n}\nreturn output;\n}",
68
+ "canonical_solution":"public static int[][] transposeMatrix(int[][] input) {\nint rows = input.length;\nint cols = input[0].length;\nint[][] output = new int[cols][rows];\nfor (int i = 0; i < rows; i++) {\nfor (int j = 0; j < cols; j++) {\noutput[j][i] = input[i][j]; \n}\n}\nreturn output;\n}",
69
+ "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\nimport java.util.Arrays;\n\npublic class Solution {\n\n",
70
+ "unit_test_assertion":" @Test\n public void testTranspose2x2() {\n int[][] input = { {1, 2}, {3, 4} };\n int[][] expected = { {1, 3}, {2, 4} };\n assertArrayEquals(expected, transposeMatrix(input), \"Should swap rows and columns correctly\");\n }\n\n @Test\n public void testTranspose3x3() {\n int[][] input = {\n {1, 2, 3},\n {4, 5, 6},\n {7, 8, 9}\n };\n int[][] expected = {\n {1, 4, 7},\n {2, 5, 8},\n {3, 6, 9}\n };\n assertArrayEquals(expected, transposeMatrix(input));\n }\n}",
71
+ "comment":"the method incorrectly assigns values to the output matrix into wrong positions, MUST assign output[j][i] = input[i][j] to transpose correctly."
72
+ }
73
+ {"id":"base_java_09","dataset_type":"base","language":"Java","task_category":"architecture",
74
+ "prompt_en":"create a singleton DatabaseConnection class in java with a getInstance method. Don't include imports",
75
+ "prompt_nl":"Maak een singleton DatabaseConnection klasse in java met een getInstance methode. Voeg geen imports toe.",
76
+ "code_snippet_input":"",
77
+ "canonical_solution":"public class DatabaseConnection {\nprivate static volatile DatabaseConnection instance;\nprivate DatabaseConnection() {\nSystem.out.println(\"Connecting to Database... Success.\");\n}\n public static DatabaseConnection getInstance() {\nif (instance == null) {\nsynchronized (DatabaseConnection.class) {\nif (instance == null) {\ninstance = new DatabaseConnection();\n}\n}\n}\nreturn instance;\n}\n}",
78
+ "unit_test_setup": "import static org.junit.Assert.*;\nimport java.lang.reflect.*;",
79
+ "unit_test_assertion": "DatabaseConnection i1 = DatabaseConnection.getInstance();\nDatabaseConnection i2 = DatabaseConnection.getInstance();\nassertNotNull(i1);\nassertSame(i1, i2);\n\nConstructor<DatabaseConnection> constructor = DatabaseConnection.class.getDeclaredConstructor();\nassertTrue(Modifier.isPrivate(constructor.getModifiers()));",
80
+ "comment":"the singleton pattern requires that only one instance of the class can exist at once. The solution MUST have a private constructor and a method getInstance() that creates a single database connection."
81
  }
 
 
 
82
  {"id":"base_java_10","dataset_type":"base","language":"Java","task_category":"refactoring",
83
  "prompt_en":"transform this function so it uses datetime objects where the deadline is at the start of the day, while still being compatible with the inputs of the software",
84
  "prompt_nl":"transformeer deze functie zodat deze datetime objecten gebruikt waarbij de deadline aan het begin van de dag ligt, terwijl deze nog steeds compatibel is met de inputs van de software.",
85
  "code_snippet_input":"public static boolean isOverdue(LocalDate deadline) {\n LocalDate today = LocalDate.now();\n return today.isAfter(deadline);\n}",
86
  "canonical_solution":"public static boolean isOverdue(LocalDate deadlineDate) {\n LocalDateTime currentDateTime = LocalDateTime.now();\n LocalDateTime deadlineTimestamp = deadlineDate.atStartOfDay();\n return currentDateTime.isAfter(deadlineTimestamp);\n}",
87
  "unit_test_setup":"import java.time.LocalDate;\nimport java.time.LocalDateTime;\nimport org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class DateTest {\n\n",
88
+ "unit_test_assertion":"@Test\n public void testYesterdayIsOverdue() {\nassertTrue(isOverdue(LocalDate.now().minusDays(1)), \"Yesterday should be overdue\");\n }\n\n @Test\n public void testTomorrowIsNotOverdue() {\n assertFalse(isOverdue(LocalDate.now().plusDays(1)), \"Tomorrow should not be overdue\");\n }\n\n @Test\n public void testTodayIsOverdue() {\nassertTrue(isOverdue(LocalDate.now()), \"Today (current time) should be considered after Today (start of day)\");\n }\n}",
89
+ "comment":"the original method ignores time of day so assignments due on the same day are not overdue, the solution MUST set the deadline to the start of the day and compare with current date and time, so that assignemnts due on the same day are overdue."
90
+ }
91
+ {"id":"base_java_11","dataset_type":"base","language":"Java","task_category":"refactoring",
92
+ "prompt_en":"this method groups transaction over 1000 by currency. refactor it to use streams and dont include imports",
93
+ "prompt_nl":"deze methode groepeert transacties van meer dan 1000 per valuta. Refactor deze om streams te gebruiken en neem geen imports op.",
94
+ "code_snippet_input":"public Map<String, List<Transaction>> groupHighValueTransactions(List<Transaction> transactions) {\nMap<String, List<Transaction>> result = new HashMap<>();\nfor (Transaction t : transactions) {\nif (t.getAmount() > 1000) {\nString currency = t.getCurrency();\nif (!result.containsKey(currency)) {\nresult.put(currency, new ArrayList<>());\n}\nresult.get(currency).add(t);\n}\n}\nreturn result;\n}",
95
+ "canonical_solution":"public Map<String, List<Transaction>> groupHighValueTransactions(List<Transaction> transactions) {\nreturn transactions.stream()\n.filter(t -> t.getAmount() > 1000)\n.collect(Collectors.groupingBy(Transaction::getCurrency));\n}",
96
+ "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport static org.junit.jupiter.api.Assertions.*;\n\n\nclass Transaction {\n private String currency;\n private double amount;\n public Transaction(String currency, double amount) { \n this.currency = currency; \n this.amount = amount; \n }\n public String getCurrency() { return currency; }\n public double getAmount() { return amount; }\n}\n\npublic class Solution {\n\n",
97
+ "unit_test_assertion":" @Test\n public void testGrouping() {\n List<Transaction> data = Arrays.asList(\n new Transaction(\"USD\", 500),\n new Transaction(\"USD\", 1500), // Keep\n new Transaction(\"EUR\", 2000),\n new Transaction(\"USD\", 3000) // Keep\n );\n \n Map<String, List<Transaction>> result = groupHighValueTransactions(data);\n \n assertEquals(2, result.size(), \"Should have keys for USD and EUR\");\n assertEquals(2, result.get(\"USD\").size(), \"USD should have 2 transactions\");\n assertEquals(1, result.get(\"EUR\").size(), \"EUR should have 1 transaction\");\n }\n}",
98
+ "comment":"the old method uses for loops conditionals and maps to group transactions, the solution MUST use java streams to filter and group the transactions effectively in a more concise way."
99
+ }
100
+ {"id":"base_java_12","dataset_type":"base","language":"Java","task_category":"refactoring",
101
+ "prompt_en":"This is a method that returns a discount code based on the day of the week, refactor the method to use a modern switch expression. Keep the same functionality and don't include imports",
102
+ "prompt_nl":"Dit is een methode die een kortingscode retourneert op basis van de dag van de week. Herstructureer de methode om een moderne switch-expressie te gebruiken. Behoud dezelfde functionaliteit en neem geen imports op.",
103
+ "code_snippet_input":"public String getDiscountCode(String dayOfWeek) {\nString discount;\nswitch (dayOfWeek) {\ncase \"Monday\":\ndiscount = \"MANIC_MONDAY_15\";\nbreak;\ncase \"Wednesday\":\ndiscount = \"WACKY_WED_10\";\nbreak;\ncase \"Friday\":\ndiscount = \"TGIF_25\";\nbreak;\ncase \"Saturday\":\ncase \"Sunday\":\ndiscount = \"WEEKEND_SAVER_20\";\nbreak;\ndefault:\ndiscount = \"STANDARD_PRICING\";\nbreak;\n}\nreturn discount;\n}",
104
+ "canonical_solution":"public String getDiscountCode(String dayOfWeek) {\nreturn switch (dayOfWeek) {\ncase \"Monday\" -> \"MANIC_MONDAY_15\";\ncase \"Wednesday\" -> \"WACKY_WED_10\";\ncase \"Friday\" -> \"TGIF_25\";\ncase \"Saturday\", \"Sunday\" -> \"WEEKEND_SAVER_20\";\ndefault -> \"STANDARD_PRICING\";\n};\n}",
105
+ "unit_test_setup":"import org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class Solution {\n // Student code injected here\n",
106
+ "unit_test_assertion":" @Test\n public void testDiscounts() {\n assertEquals(\"MANIC_MONDAY_15\", getDiscountCode(\"Monday\"));\n assertEquals(\"TGIF_25\", getDiscountCode(\"Friday\"));\n assertEquals(\"WEEKEND_SAVER_20\", getDiscountCode(\"Saturday\"), \"Should match first weekend day\");\n assertEquals(\"WEEKEND_SAVER_20\", getDiscountCode(\"Sunday\"), \"Should match second weekend day\");\n assertEquals(\"STANDARD_PRICING\", getDiscountCode(\"Tuesday\"), \"Default case check\");\n }\n}",
107
+ "comment":"the old method uses the old switch statement with multiple breaks and variable assignments, the solution MUST use the modern switch expression syntax introduced in Java 14 while keeping the same functionality."
108
  }
 
 
109
 
110
  {"id":"base_javascript_01","dataset_type":"base","language":"JavaScript","task_category":"scaffolding","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
111
  {"id":"base_javascript_02","dataset_type":"base","language":"JavaScript","task_category":"elem_func","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
 
140
  {"id":"base_python_15","dataset_type":"base","language":"Python","task_category":"refactoring","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
141
 
142
  {"id":"base_sql_01","dataset_type":"base","language":"SQL","task_category":"queries",
143
+ "prompt_en":"I am calculating and retrieving data for a tableau chart using an MSSQL query. Above the chart is AGG (average number of customer hours cost center), which is SUM([Direct Time In Hours])/[numberofclients].[Sum unique clients cost center]. Sum unique clients cost center is in Tableau with the following calculation: SUM({FIXED [Year], [Month], [Cost Center Name]: COUNTD([Client])}) I want the tableau to have a row per cost center per month, and all the data comes from the numberofclients table. Can you convert this to an MSSQL database query?",
144
+ "prompt_nl":"Ik bereken en haal gegevens op voor een tableau chart met behulp van een MSSQL query. Boven de chart staat AGG (average number of customer hours cost center), wat SUM([Direct Time In Hours])/[numberofclients].[Sum unique clients cost center]. Som unieke klanten kostenplaats staat in Tableau met de volgende berekening: SUM({FIXED [Year], [Month], [Cost Center Name]: COUNTD([Client])}) Ik wil dat het tableau één rij per kostenplaats per maand heeft en dat alle gegevens afkomstig zijn uit de tabel aantalklanten. Kunt u dit omzetten naar een MSSQL databasequery?",
145
  "code_snippet_input":"",
146
+ "canonical_solution":"SELECT \n[Year],\n[Month],\n[Cost Center Name],\nSUM([Direct Time In Hours]) AS TotalHours,\nCOUNT(DISTINCT [Client]) AS UniqueClientsPerMonth,\nSUM([Direct Time In Hours]) / NULLIF(CAST(COUNT(DISTINCT [Client]) AS FLOAT), 0) AS AvgCustomerHours\nFROM \nnumberofclients\nGROUP BY \n[Year], \n[Month], \n[Cost Center Name];",
147
  "unit_test_setup":"",
148
  "unit_test_assertion":""
149
  }