### Create Directory Example Source: https://help.loginom.ru/userguide/processors/integration/exec-program.html Example of creating a directory using cmd.exe with the /C flag. ```bash cmd.exe /C mkdir D:\Dir\ ``` -------------------------------- ### Example BatchLauncher Execution on Windows Source: https://help.loginom.ru/userguide/scheduler/batchlauncher.html A practical example demonstrating how to launch a Loginom package named 'test.lgp' in teaching mode using BatchLauncher on Windows. ```bash "C:\ Program Files\Loginom\Server\BatchLauncher.exe" /Package=test.lgp /Teach ``` -------------------------------- ### Date/Time Formatting Example Source: https://help.loginom.ru/userguide/processors/transformation/trans-datatime/syntax.html Demonstrates how to use date and time formatting markers to transform a date string into a custom format. The example shows the input, the formatting string with markers, and the resulting output. ```plaintext 11.08.2017 13:50 → любой текст Aug, еще текст 2017, 13 ``` ```plaintext "любой текст %M, еще текст %Y, %G" → "любой текст Aug, еще текст 2017, 13" ``` -------------------------------- ### HTTP Headers Log Example Source: https://help.loginom.ru/userguide/admin/parameters/logging-parameters/log-format.html An example of HTTP headers logged by Loginom, showing key-value pairs for request headers. ```log "HEADERS": "{host=localhost:8080,connection=Upgrade,pragma=no-cache,cache-control=no-cache,\"user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 OPR/119.0.0.0\",upgrade=websocket,origin=http://localhost,sec-websocket-version=13,\"accept-encoding=gzip, deflate, br, zstd\",\"accept-language=ru,en-US;q=0.9,en;q=0.8,ru-RU;q=0.7\",sec-websocket-key=Tp7wqmeSRi9BFO60AN5kSg==,\"sec-websocket-extensions=permessage-deflate; client_max_window_bits\"}" ``` -------------------------------- ### JavaScript Example Usage Source: https://help.loginom.ru/userguide/processors/programming/java-script/input-tables.html Provides a comprehensive JavaScript code example demonstrating the usage of `InputTables`, `InputTable`, properties, and methods for data access and manipulation. ```APIDOC ```javascript import { InputTable, InputTables } from "builtIn/Data"; let inputTable0 = InputTables[0], // Data source from port #1 inputTable1 = InputTables[1]; // Data source from port #2 let colOutlook0 = inputTable0.Columns.OUTLOOK, // Get column reference by name colDefault0 = inputTable0.GetColumn("DEFAULT"); let colOutlook1 = inputTable1.Columns[0], // Get column reference by index colDefault1 = inputTable1.GetColumn(1); // Get an array of columns from the Columns object let arrayOfColumns = Array.from(InputTable.Columns); // Log column property values to the console arrayOfColumns.forEach(column => { console.log("Index: ", column.Index); console.log("Name: ", column.Name); console.log("DisplayName: ", column.DisplayName); console.log("DataType: ", column.DataType); console.log("DataKind: ", column.DataKind); console.log("UsageType: ", column.UsageType); console.log("DefaultUsageType: ", column.DefaultUsageType); console.log("RowCount: ", column.RowCount); console.log(""); }); // Get an array of values from the "CLASS" column let arrayOfColumnValues = Array.from(InputTable.Columns["CLASS"]); // Log "CLASS" column values arrayOfColumnValues.forEach((value, index) => { console.log(index, ":", value); }); // Read values from the input table using the Get method for (let i = 0, с = InputTable.RowCount; i < с; i++) { // Log values from column with index 0 console.log(`InputTable.Get(${i}, 0) = `, InputTable.Get(i, 0)); // Log values from column with name "CLASS" console.log(`InputTable.Get(${i}, "CLASS") = `, InputTable.Get(i, "CLASS")); } ``` ``` -------------------------------- ### Python Console Output Examples Source: https://help.loginom.ru/userguide/processors/programming/python/console.html Demonstrates writing to standard output (`sys.stdout`) and standard error (`sys.stderr`) in Python. Includes examples of printing paths, writing strings, issuing warnings, and catching exceptions to stderr. ```python import sys, warnings #вывод в stdout print(sys.path[0]) sys.stdout.write(str(99) + '\n') #вывод в stderr warnings.warn("Ошибка!") try: а = 10 / 0 except ZeroDivisionError as err: sys.stderr.write(str(ZeroDivisionError)) ``` -------------------------------- ### Macro Substitution Example Source: https://help.loginom.ru/userguide/processors/integration/exec-program.html Demonstrates using macro substitution for commands within cmd.exe. ```bash cmd.exe /C %ИмяПеременной% ``` -------------------------------- ### Connection String Examples for MS SQL Source: https://help.loginom.ru/userguide/integration/connections/list/wh-mssql.html Examples of connection strings for MS SQL Server. The format is host[:port]:database, where port is optional and defaults to 1433. ```text srv-db:db ``` ```text srv-db:1433:db ``` -------------------------------- ### Continuous External Binning Table Example Source: https://help.loginom.ru/userguide/processors/preprocessing/coarse-classes/configure-external-binning.html Example of a table structure for continuous external binning. Ensure 'ColumnName' matches the source data field, 'UpperBound' defines the interval limits, and 'IncludeUpperBound' specifies if the upper bound is inclusive. ```text Имя столбца | Верхняя граница | Верхняя граница включена ---|---|--- COL2 | 3728129 | False COL2 | 7934343 | False COL2 | 10533052 | False COL2 | 30721946 | False COL2 | 36494956 | False COL2 | 39509806 | False COL8 | 490,01 | False COL8 | 2308,07 | False COL8 | 5981,98 | False COL8 | 6600,01 | False COL8 | 10050,99 | False COL8 | 14870 | False ``` -------------------------------- ### Example Substitution File Format Source: https://help.loginom.ru/userguide/processors/transformation/substitution/import-tz.html This is an example of a text file used for importing timezone substitutions. It contains two columns separated by a tab character: the value to be replaced and the new value. Ensure UTF-8 encoding and no headers. Decimal separators depend on locale. ```text Средний балл Новый средний балл 4,99 5 4,99 4,69 4,97 4,51 4,92 4,49 4,91 4,47 4,88 4,40 4,85 4,35 4,84 4,30 4,84 4,25 4,79 4,20 ``` -------------------------------- ### ES6 Module: Absolute Import Path on Server Source: https://help.loginom.ru/userguide/processors/programming/java-script/external-modules.html Example of an absolute import path for an ES6 module on the Loginom server. ```javascript import { cube, foo, sayHello } from "/user/foo/foo.js"; ``` -------------------------------- ### Get Display Name of Node Source: https://help.loginom.ru/userguide/processors/func/calc-func/data-tree.html Use DisplayName() to get the label (display name) of a node, expression, or variable by its path. If no path is provided, it returns the label of the currently evaluated expression. Example: DisplayName("Root.Node1"). ```calculator DisplayName("ПутьУзла") ``` ```calculator DisplayName("Root.Node1") ``` -------------------------------- ### Package Parameter Example with Path Source: https://help.loginom.ru/userguide/scheduler/batchlauncher.html Illustrates how to specify the path to a Loginom package file using the /Package parameter. Handles spaces in file paths by enclosing the path in quotes. ```bash "C:\ Program Files\Loginom\Server\BatchLauncher.exe" /Package=/user/test.lgp ``` ```bash "C:\ Program Files\Loginom\Server\BatchLauncher.exe" "/Package=/user/test and log.lgp" ``` -------------------------------- ### Get Item Index in Array Source: https://help.loginom.ru/userguide/processors/func/calc-func/data-tree.html Use ItemIndex() to get the zero-based index of an expression within an array. It takes no arguments. ```calculator ItemIndex() ``` -------------------------------- ### Node Execution Example Source: https://help.loginom.ru/userguide/scheduler/batchlauncher.html Demonstrates how to execute a specific node within a Loginom package using the /Node parameter. This executes the specified node and all preceding nodes required for its input data. ```bash "C:\ Program Files\Loginom\Server\BatchLauncher.exe" /Package=/user/test.lgp "/Node=executable node" ``` ```bash "C:\ Program Files\Loginom\Server\BatchLauncher.exe" /Package=/user/test.lgp /Node=executable_node ``` -------------------------------- ### Corrected XML Declaration Example Source: https://help.loginom.ru/userguide/processors/integration/extracting-xml.html This example shows a correctly interpreted XML declaration when the 'Unescape XML entities' option is enabled. ```xml ``` -------------------------------- ### BatchLauncher Syntax for Windows Source: https://help.loginom.ru/userguide/scheduler/batchlauncher.html Defines the command-line syntax for executing Loginom packages in batch mode on Windows. Includes parameters for package file, teaching mode, deactivation, node selection, server address, port, user credentials, variables, and saving results. ```bash "C:\ Program Files\Loginom\Server\BatchLauncher.exe" /Package= [/Teach] [/Deactivate=] [/Node=] [/Address=
] [/Port=] [/UserName= [/Password=]] [/VarName=] [/PortName.VarName=] [/Save] ``` -------------------------------- ### Example of Merging Data Trees Source: https://help.loginom.ru/userguide/processors/data-trees/union-tree.html Demonstrates the schema and data resulting from merging two input trees. Shows how simple types are always present (possibly null) while containers/arrays are optional. ```text */ Главное дерево /* ☰ user ├──(ab) tag: "admin" ├──(0/1) blocked: true └── ☰ permissions └── ☰ fileStorage └──(0/1) read: true */ Присоединяемое дерево /* ☰ user ├──(ab) tag: "viewer" ├──(ab) fullName: "Петров Н.Н." └── ☰ permissions ├── ☰ fileStorage │ └──(0/1) write: false └── ☰ planner └──(0/1) accessAllTasks: true ``` Результат объединения: ``` */ Объединённая схема /* [☰] user // Массив элементов user ├──(ab) tag // Строковый тип данных ├──(0/1) blocked // Логический тип данных ├──(ab) fullName // Строковый тип данных └── ☰ permissions ├── ☰ fileStorage │ ├──(0/1) read // Логический │ └──(0/1) write // Логический └── ☰ planner └──(0/1) accessAllTasks // Логический */ Объединенные данные /* ├── ☰ user // Контейнер planner отсутствует для этого user │ ├──(ab) tag: "admin" │ ├──(0/1) blocked: true │ ├──(ab) fullName: null │ └── ☰ permissions │ └── ☰ fileStorage │ ├──(0/1) read: true │ └──(0/1) write: null └── ☰ user ├──(ab) tag: "viewer" ├──(0/1) blocked: null ├──(ab) fullName: "Петров Н.Н." └── ☰ permissions ├── ☰ fileStorage │ ├──(0/1) read: null │ └──(0/1) write: false └── ☰ planner └──(0/1) accessAllTasks: true ``` ``` -------------------------------- ### XML Declaration Example Source: https://help.loginom.ru/userguide/processors/integration/extracting-xml.html This example shows a correctly escaped XML declaration. Ensure the 'Unescape XML entities' option is enabled if your XML documents are escaped. ```xml <\?xml version=\"1.0\" encoding=\"UTF-8\"?\> ``` -------------------------------- ### Running Batch in Teach Mode Source: https://help.loginom.ru/userguide/scheduler/batchlauncher.html Execute a package in 'Teach' mode by including the /Teach parameter. If omitted, the package runs in 'Execution' mode. ```bash "C:\Program Files\Loginom\Server\BatchLauncher.exe" /Package=/user/test.lgp /Teach ``` -------------------------------- ### Journald Log Entry Example Source: https://help.loginom.ru/userguide/admin/parameters/logging-parameters/log-format.html Example log entries as they appear when using journald, typically viewed with `journalctl`. These logs include timestamp, hostname, process name, and the log message. ```log июн 25 10:20:11 astra loginomd[563]: Инициализирована сессия для пользователя user июн 25 10:20:16 astra loginomd[563]: Открыт пакет "/user/Package1.lgp" в режиме редактирования июн 25 10:20:36 astra loginomd[563]: Активация узла "Переменные в таблицу" GUID={6A5BF7B5-91CB-47EA-A0BC-06F29C63B681} июн 25 10:20:36 astra loginomd[563]: Успешно активирован узел "Переменные в таблицу" GUID={6A5BF7B5-91CB-47EA-A0BC-06F29C63B681} июн 25 10:20:58 astra loginomd[563]: В результате вычисления выражения "Выражение1" получено значение строкового типа, оно несовместимо с заданным типом Вещественный июн 25 10:21:00 astra loginomd[563]: Активация узла "Калькулятор" GUID={8A54DC3C-1B60-47B0-9F44-49C22FE5AE79} июн 25 10:21:00 astra loginomd[563]: Ошибка активации узла "Калькулятор" GUID={8A54DC3C-1B60-47B0-9F44-49C22FE5AE79} июн 25 10:21:06 astra loginomd[563]: Деактивирован узел "Калькулятор" GUID={8A54DC3C-1B60-47B0-9F44-49C22FE5AE79} июн 25 10:21:08 astra loginomd[563]: Сохранён пакет "/user/Package1.lgp" июн 25 10:21:10 astra loginomd[563]: Закрыт пакет "/user/Package1.lgp" июн 25 10:21:13 astra loginomd[563]: Закрыта сессия для пользователя user июн 25 10:45:06 astra loginomd[563]: Инициализирована сессия для пользователя admin июн 25 10:50:16 astra loginomd[563]: Изменился параметр сервера "Период проверки соединения с клиентом" июн 25 10:50:41 astra loginomd[563]: Изменился параметр компонента сервера Python:"Выполнение запрещено" июн 25 10:51:27 astra loginomd[563]: Закрыта сессия для пользователя admin ``` -------------------------------- ### Log Entry Format Example Source: https://help.loginom.ru/userguide/admin/parameters/logging-parameters/log-format.html Demonstrates the standard format of a log entry in a file, including timestamp, level, message, and optional JSON parameters. ```text 2025-06-24T15:51:41.100 info 62daaab383b6e040b3e7f113bfd48cc1 (loginomd.exe:6956>user:26) - Инициализирована сессия для пользователя user {"USER_NAME": "user", "SESSION_TYPE": "Интерактивная сессия", "CLIENT_IP": "127.0.0.1", ``` -------------------------------- ### Reading Data with Get Method Source: https://help.loginom.ru/userguide/processors/programming/python/input-tables.html Demonstrates using the `Get` method to retrieve data from a specific row and column, accessed by either row index and column index, or row index and column name. ```python #Чтение значений из входной таблицы методом Get for i in range(InputTable.RowCount): #Вывод значений столбца с индексом 0 print("InputTable.Get({}, 0) = {}".format(i, InputTable.Get(i, 0))) #Вывод значений столбца с именем "CLASS" print("InputTable.Get({}, 'CLASS') = {}".format(i, InputTable.Get(i, "CLASS"))) ``` -------------------------------- ### BatchLauncher Syntax for Linux Source: https://help.loginom.ru/userguide/scheduler/batchlauncher.html Defines the command-line syntax for executing Loginom packages in batch mode on Linux. Uses hyphens for parameters and specifies the directory where BatchLauncher is located. ```bash Directory/BatchLauncher -package= [-teach] [-deactivate=] [-node=] [-address=
] [-port=] [-userName=] [-password=] [-vаrname=] [-portname.varname=] [-save] ``` -------------------------------- ### mkdirSync Source: https://help.loginom.ru/userguide/processors/programming/java-script/fileapi.html Creates a directory. Returns undefined. ```APIDOC ## mkdirSync(path, options, mode) ### Description Creates a directory. Returns `undefined`. ### Parameters #### Path Parameters - **path** (string) - Required - The path of the directory to create. #### Options - **recursive** (boolean) - Optional - Specifies whether to create parent directories. Defaults to `false`. - **mode** (number | string) - Optional - File mode (not used on Windows). Defaults to `0o777`. ``` -------------------------------- ### Discrete External Binning Table Example Source: https://help.loginom.ru/userguide/processors/preprocessing/coarse-classes/configure-external-binning.html Example of a table structure for discrete external binning. 'ColumnName' should match the source data field, 'UniqueValue' is the specific value from the source field, and 'ClassNumber' assigns a class to that value. ```text Имя столбца | Номер класса | Уникальное значение ---|---|--- COL4 | 0 | жен COL4 | 1 | муж COL4 | 2 | NULL COL4 | 2 | COL6 | 0 | Бронзовый COL6 | 1 | Серебряный COL6 | 2 | Золотой COL6 | 2 | Платиновый ``` -------------------------------- ### Input Data for Union Tree Example Source: https://help.loginom.ru/userguide/processors/data-trees/union-tree.html Defines the structure and sample data for three input trees used in the union tree demonstration. Includes active and inactive ports. ```text */ Главное дерево (порт «Главное дерево») /* ☰ user ├──(ab) tag: "admin" // Строковый ├──(0/1) blocked: true // Логический └── ☰ permissions ├──(0/1) packagePublish: true // Логический └── ☰ fileStorage ├──(0/1) read: true // Логический └──(0/1) write: false // Логический */ Присоединяемое дерево 1 /* ☰ user ├──(12) tag: 100 // Целый ├──(ab) fullName: "Петров Н.Н." // Строковый └── ☰ permissions ├──(0/1) packagePublish: false // Логический ├── ☰ fileStorage │ ├──(0/1) read: true // Логический │ └──(0/1) delete: true // Логический └── ☰ planner └──(0/1) accessAllTasks: true // Логический */ Присоединяемое дерево 2 (неактивный порт, данные отсутствуют) /* // в порту определена схема: [☰] user // Массив элементов user ├──(0/1) tag // третий тип для tag └── ☰ permissions └──(9.0) limit // дополнительный элемент ``` -------------------------------- ### Get File Status Synchronously Source: https://help.loginom.ru/userguide/processors/programming/java-script/api-description.html Returns the status of a file descriptor synchronously. ```typescript function fstatSync(fd: FileHandle): Stats; ``` -------------------------------- ### Accessing Input Tables and Columns in JavaScript Source: https://help.loginom.ru/userguide/processors/programming/java-script/input-tables.html Demonstrates how to access input data sources from different ports using InputTables and retrieve column references by name or index. Also shows how to get an array of all columns and their properties. ```javascript import { InputTable, InputTables } from "builtIn/Data"; let inputTable0 = InputTables[0], // Источник данных с порта №1 inputTable1 = InputTables[1]; // Источник данных с порта №2 let colOutlook0 = inputTable0.Columns.OUTLOOK, // Получение ссылки на столбец по имени colDefault0 = inputTable0.GetColumn("DEFAULT"); let colOutlook1 = inputTable1.Columns[0], // Получение ссылки на столбец по индексу colDefault1 = inputTable1.GetColumn(1); // Получение из объекта Columns массива столбцов let arrayOfColumns = Array.from(InputTable.Columns); // Вывод значений свойств столбцов в консоль arrayOfColumns.forEach(column => { console.log("Index: ", column.Index); console.log("Name: ", column.Name); console.log("DisplayName: ", column.DisplayName); console.log("DataType: ", column.DataType); console.log("DataKind: ", column.DataKind); console.log("UsageType: ", column.UsageType); console.log("DefaultUsageType: ", column.DefaultUsageType); console.log("RowCount: ", column.RowCount); console.log(""); }); // Получение из столбца "CLASS" массива значений let arrayOfColumnValues = Array.from(InputTable.Columns["CLASS"]); // Вывод значений столбца "CLASS" arrayOfColumnValues.forEach((value, index) => { console.log(index, ":", value); }); // Чтение значений из входной таблицы методом Get for (let i = 0, с = InputTable.RowCount; i < с; i++) { // Вывод значений столбца с индексом 0 console.log(`InputTable.Get(${i}, 0) = `, InputTable.Get(i, 0)); // Вывод значений столбца с именем "CLASS" console.log(`InputTable.Get(${i}, "CLASS") = `, InputTable.Get(i, "CLASS")); } ``` -------------------------------- ### ES6 Module: Relative Import Path Source: https://help.loginom.ru/userguide/processors/programming/java-script/external-modules.html Example of a relative import path for an ES6 module. ```javascript import { cube, foo, sayHello } from "./foo/foo.js"; ``` -------------------------------- ### Creating a new Response object Source: https://help.loginom.ru/userguide/processors/programming/java-script/fetch-api.html Demonstrates the constructor for creating a new Response object. The body and init parameters are optional. ```javascript let response = new Response([body][, init]); ```