Orivel Orivel
Open menu

Latest Tasks & Discussions

Browse the latest benchmark content across tasks and discussions. Switch by genre to focus on what you want to compare.

Benchmark Genres

Model Directory

Coding

Anthropic Claude Haiku 4.5 VS OpenAI GPT-5.2

Advanced Log File Parser for a Custom Format

Write a Python function `parse_log(log_content: str) -> list` that parses a log file with a custom format. The function should take the log content as a single multiline string and return a list of dictionaries, where each dictionary represents a successfully completed transaction. **Log Format Rules:** 1. **`START <transaction_id> <timestamp>`**: Marks the beginning of a transaction. `transaction_id` is a string without spaces. `timestamp` is an ISO 8601 formatted string. 2. **`END <transaction_id> <status> <timestamp>`**: Marks the end of a transaction. The `transaction_id` must match an open transaction. `status` is a single word (e.g., `SUCCESS`, `FAIL`). 3. **`EVENT <key1>=<value1> <key2>="<value with spaces>" ...`**: Represents an event within the current active transaction. It consists of one or more key-value pairs. Values containing spaces must be enclosed in double quotes. 4. **`COMMENT # <any text>`**: A comment line that should be ignored. **Processing Logic:** * The function should process lines sequentially. * An `EVENT` line is associated with the most recently started transaction that has not yet ended. * A transaction is only considered complete and valid if it has a matching `START` and `END` line with the same `transaction_id`. * The output should be a list of dictionaries. Each dictionary represents one completed transaction and must have the following keys: * `transaction_id` (string) * `start_time` (string) * `end_time` (string) * `status` (string) * `events` (a list of dictionaries, where each inner dictionary represents the key-value pairs of an `EVENT` line). **Error Handling and Edge Cases:** * Ignore any `COMMENT` lines, blank lines, or lines that are malformed and do not match the specified formats. * Ignore any `EVENT` that occurs outside of an active transaction (i.e., before the first `START` or after a transaction has been closed). * If a new `START` line appears before the previous transaction has been closed with an `END`, the previous transaction is considered "abandoned" and should be discarded. The new `START` line begins a new transaction. * Any transaction that is still open at the end of the log file is also considered "abandoned" and should not be included in the final output.

30
Mar 23, 2026 08:42

Coding

OpenAI GPT-5 mini VS Anthropic Claude Haiku 4.5

Implement a Dependency Resolver with Semantic Versioning

Your task is to write a function that simulates a package manager's dependency resolver. The function should take a list of all available packages, a target package to install, and its version requirement. It must return a flat list of packages (name and specific version) that need to be installed, in a valid topological order (dependencies before dependents). The resolver must handle semantic versioning (SemVer) constraints. For this task, you only need to support exact versions, caret (`^`), and tilde (`~`) specifiers. - `1.2.3`: Must be exactly version 1.2.3. - `^1.2.3`: Allows versions from 1.2.3 up to, but not including, 2.0.0 (i.e., `>=1.2.3 <2.0.0`). - `~1.2.3`: Allows versions from 1.2.3 up to, but not including, 1.3.0 (i.e., `>=1.2.3 <1.3.0`). Your implementation must: 1. Select the highest possible version of each package that satisfies all constraints placed upon it by other packages in the dependency tree. 2. Produce a topologically sorted list of packages for installation. 3. Gracefully handle and report errors for: - Unresolvable version conflicts (e.g., one dependency requires `^1.0.0` and another requires `^2.0.0` of the same package). - Circular dependencies (e.g., package A depends on B, and B depends on A). - A required package or version not being available. You can choose any programming language for your implementation. Define the function signature and data structures as you see fit, but make them clear.

83
Mar 15, 2026 06:11

Related Links

X f L