コード例 #1
0
from languages.java import JavaTask

# Description
# Implement dessertFrequencies method to calculate how many people likes each kind of dessert.

task = JavaTask()
task.set_solution_class_name("DessertLovers")
コード例 #2
0
from languages.java import JavaTask

# Description
# Implement converter of IPv4 addresses. ipToDec, ipToBin, ipToHex.

task = JavaTask()
task.set_solution_class_name("IpConverter")
task.test_descriptions = ["Decimal ip. Check toDec(), toHex(), toBin().",
                          "Hex ip. Check toDec(), toHex(), toBin().",
                          "Binary ip. Check toDec(), toHex(), toBin()."]
コード例 #3
0
from languages.java import JavaTask

# Description
# Implement method that returns one of 3 different string comparator: ascending, descending, byLength, byWordCount.

task = JavaTask()
task.set_solution_class_name("StringComparison")
task.test_descriptions = ["Checks ascending order.",
                          "Checks descending order.",
                          "Checks by length order."
                          "Checks by word count order."]
コード例 #4
0
from languages.java import JavaTask

# Description
# Implement Promise class that implements java.util.concurrent.Future and allows to set value.

task = JavaTask()
task.set_solution_class_name("Promise")
task.test_descriptions = [
    "Check normal flow: delayed set() then get() in separate thread.",
    "Check get with timeout when timeout is not reached.",
    "Check get with timeout when timeout is reached and exception must be thrown.",
    "Check multiple set() invocation.",
    "Check cancel() when no thread waits on get().",
    "Check cancel() when thead is blocked on get().",
    "Check cancel() when promise alread done.",
]
コード例 #5
0
from languages.java import JavaTask

# Description
# Implement ConcatStream class that concatenates InputStreams

task = JavaTask()
task.set_solution_class_name("ConcatStream")
task.test_descriptions = ["Checks read() with 1 stream.",
                          "Checks read() with 2 streams.",
                          "Checkss read() with 5 streams. One of them is empty.",
                          "Checks read(byte[]) with 1 stream.",
                          "Checks read(byte[]) with 3 streams. One of them is empty.",
                          "Checks read(byte[]) with 1 stream that lazily generates 100.000.000 bytes.",
                          "Checks read(byte[]) with 5 streams. Each lazily generates 50.000.000.",
                          "Checks read(byte[], int, int) with 1 stream.",
                          "Checks read(byte[], int, int) with 3 streams.",
                          "Checks available() with 5 streams.",
                          "Checks close() with 10 streams."]
コード例 #6
0
from languages.java import JavaTask

# Description
# Write 'Hello, world.' to console.

task = JavaTask()
task.set_solution_class_name("HelloWorld")
コード例 #7
0
from languages.java import JavaTask

# Description
# Implement gesture recognition algorithm. It takes 2-d array of points (each row - array of points at particular moment).
# should recogninze slide left/right/up/down, double slide left/right/up/down and zoom in/out gestures.

task = JavaTask()
task.set_solution_class_name("GestureRecognition")
task.test_descriptions = ["Slide right.",
                          "Slide right.",
                          "Slide left.",
                          "Slide left.",
                          "Slide up.",
                          "Slide up.",
                          "Slide down.",
                          "Slide down.",
                          "Double slide right",
                          "Double slide right",
                          "Double slide left",
                          "Double slide left",
                          "Double slide up",
                          "Double slide up",
                          "Double slide down",
                          "Double slide down",
                          "Zoom in (horizontal)",
                          "Zoom in (vertical)",
                          "Zoom out (horizontal)",
                          "Zoom out (vertical)"]
コード例 #8
0
from languages.java import JavaTask

# Description
# Write 'frequencies' function that takes array of ints where every int from 0 to 99. Return array of frequencies.

task = JavaTask()
task.set_solution_class_name("Frequencies")
コード例 #9
0
from languages.java import JavaTask

# Description
# Implement DI container.

task = JavaTask()
task.set_solution_class_name("DependencyInjector")
task.test_descriptions = ["Checks getComponent(Class).",
                          "Checks getComponent(String).",
                          "Checks classes registration in inverse order: injected component registered last.",
                          "Checks that null injected when no components match.",
                          "Checks that null is returned when not registered component is requested.",
                          "Checks Scope.SINGLETON",
                          "Checks Scope.PROTOTYPE",
                          "Checks inheritance: super class fields must be also processed by container."]