This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Создать список правил грамматики | |
| 2. Класс Цепочка. | |
| 3. Генерить множество начальных цепочек для | |
| ids -> id, ids | |
| ids -> id | |
| operator -> var ids | |
| operator -> val id = expr | |
| operator -> fun id (ids) = expr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Syntax analyser | |
| # Операторы | |
| # var id{,id}* | |
| # val id = выражение | |
| # fun id (id{,id}*) = выражение | |
| # Выражения | |
| # let операторы in выражение end | |
| # if выражение then выражение else выражение | |
| # операция выражение |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import codecs | |
| from itertools import cycle | |
| parser = argparse.ArgumentParser(description='XOR en/decrypter') | |
| parser.add_argument('--key', type=str, nargs=1, required=True) | |
| parser.add_argument('--file', type=str, nargs=1, required=True) | |
| parser.add_argument('--decrypt', required=False, action='store_true') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const o = { | |
| ras: 2, | |
| dva: 3, | |
| tri: 4, | |
| }; | |
| const b = { ras: 3, dva: 5, }; | |
| console.log(o); | |
| console.log(b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var not = window.Notification || window.mozNotification || window.webkitNotification; | |
| Notification.requestPermission(p => {}); | |
| list = [ | |
| "Слава выбросил своих кеды!", | |
| "Пыльник в наших сердцах!", | |
| "Между первой и второй - вишнёвая", | |
| "Будем играть что ль первого января?", | |
| "Спартак - чемпик", | |
| "Я за сток сити, блять!", | |
| "Максим Кривопатря - новый администратор АДФС" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const details = [40, 20, 31, 79, 100]; | |
| const templates = [ | |
| [10, 0, 0, 0, 20], | |
| [5, 5, 0, 5, 5], | |
| [3, 6, 8, 5, 0], | |
| [2, 0, 0, 0, 1], | |
| ] | |
| const maxTemplates = [4, 8, 1, 10]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def decorator(func): | |
| def result(*args, **kwargs): | |
| print ('log function!', func) | |
| return func(*args, **kwargs) | |
| return result | |
| def regenerate(d): | |
| new_d = {} | |
| for i, j in d.items(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <queue> | |
| #define V 4 | |
| using namespace std; | |
| bool isBipartite(int G[][V], int src) { | |
| int colorArr[V]; | |
| for (int i = 0; i < V; ++i) | |
| colorArr[i] = -1; | |
| colorArr[src] = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function copy(str){ | |
| let tmp = document.createElement('INPUT'), // Создаём новый текстовой input | |
| focus = document.activeElement; // Получаем ссылку на элемент в фокусе (чтобы не терять фокус) | |
| tmp.value = str; // Временному input вставляем текст для копирования | |
| document.body.appendChild(tmp); // Вставляем input в DOM | |
| tmp.select(); // Выделяем весь текст в input | |
| document.execCommand('copy'); // Магия! Копирует в буфер выделенный текст (см. команду выше) | |
| document.body.removeChild(tmp); // Удаляем временный input |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <iterator> | |
| #include <algorithm> | |
| using namespace std; | |
| template <typename RandomIt> | |
| void MergeSort(RandomIt range_begin, RandomIt range_end) { | |
| if (next(range_begin) == range_end) { |