Skip to content

Instantly share code, notes, and snippets.

View kirilltobola's full-sized avatar
🔺

Kirill Tobola kirilltobola

🔺
View GitHub Profile
CREATE OR REPLACE FUNCTION create_record_queue(customer_full_name_in character varying)
RETURNS TABLE(
customer_full_name character varying,
queue_number integer,
operator_place character varying
)
LANGUAGE 'plpgsql'
AS $body$
DECLARE
next_operator_id integer;
#!/bin/python3
class tree():
def add(self, variable):
self.variables.append(variable)
def create(self, namespace):
namespace.parent = self
self.children.append(namespace)
@kirilltobola
kirilltobola / lab1.pl
Created January 21, 2022 14:28
Prolog AI
% Тобола К. 2471 - lab1, #6:
% Кто одновpеменно большой и темный? X=bear
% Есть ли коpичневые маленькие слоны? false.
% Есть ли большие и темные медведи? true.
% Есть ли чеpный кот? true.
% facts:
big(bear).
big(elephant).
small(cat).
@kirilltobola
kirilltobola / 5.1.py
Created December 27, 2021 17:44
ter inf 5, 6 lab
import formulas as f
matrix: list = [
[1/16, 6/16, 1/16],
[3/16, 2/16, 3/16],
]
if __name__ == '__main__':
h_a, h_b = f.H(matrix)
@kirilltobola
kirilltobola / 1.cpp
Last active December 23, 2021 16:44
lab 9.
#include <iostream>
using namespace std;
class rational {
private:
long long _nom, _denom;
long long gcd(long long a, long long b) {
if (a * b == 0) return a + b;
@kirilltobola
kirilltobola / 12.cpp
Last active December 2, 2021 16:41
OOP lab8
#include <iostream>
using namespace std;
class rational {
private:
long long nom;
unsigned long long denom;
public:
rational() {
@kirilltobola
kirilltobola / 16.cpp
Last active November 28, 2021 15:43
Functoins (lab 7)
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<double> arr = {1.9, 1.32, 1.0, 5.8, 5.1, 12.6, 13.2, 13.1};
@kirilltobola
kirilltobola / 9.py
Created October 21, 2021 17:11
HW FOAT
eps = 10 ** -12
a, b, c, d = map(float, input().split())
if abs((a+b) - (c+d)) < eps:
print('equals')
elif (a+b) - (c+d) > eps:
print('a+b greater')
elif (a+b) - (c+d) < eps:
print('c+d greater')
@kirilltobola
kirilltobola / 11.cpp
Last active October 14, 2021 17:58
HW ЯП лекция2
#include <iostream>
int main()
{
int a = 157;
int c = 0365;
int d = 36'000'000;
int e = 0377;
int g = 0x3fff;
int h = 0X3FFF;
@kirilltobola
kirilltobola / 5.py
Last active October 7, 2021 14:34
hw_bernulli
import math
ru_alphabet = {
'а': 8.01,
'б': 1.59,
'в': 4.54,
'г': 1.70,
'д': 2.98,
'е': 8.45,
'ё': 0.04,