Управление индексом
Индекс и пользовательский корпус
Здесь можно пересобрать индекс по `benchmarks/datasets` вместе с пользовательским корпусом, а также отдельно управлять пользовательским корпусом без смешивания сценариев загрузки.
Состояние базы поиска
Показать подробности
Индекс
Пополнение пользовательского корпуса
Файлы хранятся отдельно в `benchmarks/datasets/web-corpus`. После любых изменений здесь индекс нужно пересобрать вручную. Удаление действует только на пользовательский корпус.
- Для одного исходника используй блок «Добавить файл в репозиторий».
- Для целого репозитория удобнее использовать блок «Импортировать ZIP-архив».
- Если репозитория с таким названием ещё нет, он будет создан автоматически.
Импортировать ZIP-архив
Подходит для целого репозитория. Если репозитория с таким названием ещё нет, он будет создан автоматически.
Добавить файл в репозиторий
Подходит для одного исходного файла. Репозиторий с таким названием тоже можно создать на лету.
Создать пустой репозиторий
Необязательный вариант, если хочешь сначала завести репозиторий, а файлы добавить позже.
Содержимое пользовательского корпуса
Пользовательский корпус пока пуст. Можно сразу загрузить файл или ZIP-архив, и репозиторий создастся автоматически.
Обзор всех репозиториев
Здесь можно просмотреть стандартные наборы и пользовательский корпус: список репозиториев, файлы и содержимое файлов.
repo_math_c
math_utils.c
#include <stddef.h>
int factorial(int value) {
if (value <= 1) {
return 1;
}
return value * factorial(value - 1);
}
int gcd(int left, int right) {
while (right != 0) {
int next = left % right;
left = right;
right = next;
}
return left;
}
repo_merge_c
merge_utils.c
typedef struct SettingNode {
const char* key;
const char* value;
struct SettingNode* child;
struct SettingNode* next;
} SettingNode;
void merge_settings(SettingNode* target, const SettingNode* defaults) {
while (defaults != NULL) {
if (target->value == NULL && defaults->value != NULL) {
target->value = defaults->value;
}
if (target->child != NULL && defaults->child != NULL) {
merge_settings(target->child, defaults->child);
}
defaults = defaults->next;
}
}
void fill_missing(SettingNode* target, const SettingNode* fallback) {
while (fallback != NULL) {
if (target->value == NULL) {
target->value = fallback->value;
}
fallback = fallback->next;
}
}
repo_policy_c
policy_utils.c
int all_positive(const int* values, int count) {
for (int index = 0; index < count; index++) {
if (values[index] <= 0) {
return 0;
}
}
return 1;
}
int strictly_increasing(const int* values, int count) {
for (int index = 1; index < count; index++) {
if (values[index] <= values[index - 1]) {
return 0;
}
}
return 1;
}
repo_text_c
text_utils.c
#include <stddef.h>
void slugify_words(const char* const* parts, size_t count, char* output, size_t output_size) {
size_t write_index = 0;
for (size_t part_index = 0; part_index < count; part_index++) {
const char* word = parts[part_index];
if (word == NULL || word[0] == '\0') {
continue;
}
if (write_index > 0 && write_index < output_size - 1) {
output[write_index++] = '-';
}
for (size_t char_index = 0; word[char_index] != '\0' && write_index < output_size - 1; char_index++) {
char current = word[char_index];
if (current >= 'A' && current <= 'Z') {
current = (char)(current - 'A' + 'a');
}
output[write_index++] = current;
}
}
output[write_index] = '\0';
}
void title_words(char* text) {
int start_of_word = 1;
for (size_t index = 0; text[index] != '\0'; index++) {
char current = text[index];
if (current >= 'a' && current <= 'z' && start_of_word) {
text[index] = (char)(current - ('a' - 'A'));
}
start_of_word = current == ' ' || current == '_' || current == '-';
}
}
repo_window_c
window_utils.c
void rotate_left(int* values, int count, int shift) {
if (count == 0) {
return;
}
shift = shift % count;
while (shift > 0) {
int first = values[0];
for (int index = 0; index < count - 1; index++) {
values[index] = values[index + 1];
}
values[count - 1] = first;
shift--;
}
}
void rotate_right(int* values, int count, int shift) {
if (count == 0) {
return;
}
shift = shift % count;
while (shift > 0) {
int last = values[count - 1];
for (int index = count - 1; index > 0; index--) {
values[index] = values[index - 1];
}
values[0] = last;
shift--;
}
}
repo_array_js
array_utils.js
function sumValues(values) {
return values.reduce((accumulator, value) => accumulator + value, 0);
}
function uniqueValues(values) {
return [...new Set(values)];
}
module.exports = { sumValues, uniqueValues };
repo_web_js
slugify.js
function slugify(value) {
const normalized = value.trim().toLowerCase();
return normalized.replace(/\s+/g, "-");
}
module.exports = { slugify };
repo_math_py
math_utils.py
def factorial(number: int) -> int:
if number <= 1:
return 1
return number * factorial(number - 1)
def gcd(left: int, right: int) -> int:
while right:
left, right = right, left % right
return left
repo_merge_py
merge_utils.py
def merge_settings(base: dict[str, object], override: dict[str, object]) -> dict[str, object]:
result = dict(base)
for key, value in override.items():
current = result.get(key)
if isinstance(current, dict) and isinstance(value, dict):
result[key] = merge_settings(current, value)
else:
result[key] = value
return result
def fill_missing(base: dict[str, object], fallback: dict[str, object]) -> dict[str, object]:
result = dict(base)
for key, value in fallback.items():
result.setdefault(key, value)
return result
repo_policy_py
policy_utils.py
def all_positive(values: list[int]) -> bool:
return all(value > 0 for value in values)
def any_positive(values: list[int]) -> bool:
return any(value > 0 for value in values)
def strictly_increasing(values: list[int]) -> bool:
pairs = zip(values, values[1:], strict=False)
return all(left < right for left, right in pairs)
repo_text_py
text_utils.py
def slugify_parts(parts: list[str]) -> str:
cleaned = [part.strip().lower() for part in parts if part.strip()]
return "-".join(cleaned)
def title_words(parts: list[str]) -> str:
cleaned = [part.strip().title() for part in parts if part.strip()]
return " ".join(cleaned)
repo_window_py
window_utils.py
def rotate_left(items: list[str], steps: int) -> list[str]:
if not items:
return []
offset = steps % len(items)
return items[offset:] + items[:offset]
def rotate_right(items: list[str], steps: int) -> list[str]:
if not items:
return []
offset = steps % len(items)
if offset == 0:
return list(items)
return items[-offset:] + items[:-offset]
Лог последних операций
Операций пока не было.