Skip to content

Instantly share code, notes, and snippets.

View Glavak's full-sized avatar

Денис Мустакимов Glavak

View GitHub Profile
@Glavak
Glavak / ht.h
Last active December 22, 2016 17:42
#pragma once
#include <string>
typedef std::string Key;
struct Value
{
unsigned age;
unsigned weight;
@Glavak
Glavak / ht.cpp
Last active December 22, 2016 17:42
#include "HashTable.h"
HashTable::HashTable()
{
table = new ListItem * [table_size];
std::fill(table, table + table_size, nullptr);
}
HashTable::~HashTable()
@Glavak
Glavak / sp.h
Last active September 29, 2016 17:55
//
// Created by glavak on 23.09.16.
//
#ifndef MYARRAY_SMARTPOINTER_H
#define MYARRAY_SMARTPOINTER_H
#include <utility>
template<class T>
@Glavak
Glavak / 1.cpp
Last active October 23, 2017 09:08
#include <string>
#include <iostream>
#include <cstdlib>
using namespace std;
template<typename T>
class list
{
private:
@Glavak
Glavak / graphs.cpp
Last active December 25, 2017 08:55
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include <vector>
#include<windows.h>
#include<iostream>
#include <Windows.h>
#include<fstream>
#include<string>
#include<conio.h>
#include <iostream>
#include <vector>
#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:4996)
class string
{
private:
@Glavak
Glavak / tester1.c
Last active January 16, 2018 14:01
#include <stdio.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <poll.h>
#include <errno.h>
int main(int argc, const char * argv[])
#include <stdio.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <poll.h>
#include <errno.h>
int main(int argc, const char * argv[])
#include "hexpoint.h"
#include "myimage.h"
#include <QDebug>
#include <QStack>
MyImage::MyImage(int width, int height) : QImage(width, height, QImage::Format_ARGB32)
{
clear(Color(240, 240, 240));
}
void IsoLinesWidget::paintIsoLines(QPainter & painter)
{
QSizeF squareSize((float)imageRect.width() / widthGridCount, (float)imageRect.height() / heightGridCount);
QVector<float> topLine(widthGridCount + 1);
QVector<float> bottomLine(widthGridCount + 1);
for (int x = 0; x < widthGridCount + 1; ++x)
{
QPointF coords = QPointF(squareSize.width()*x, 0);