Skip to content

Instantly share code, notes, and snippets.

Vasily Alferov vasalf

  • Saint Petersburg
Block or report user

Report or block vasalf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Monads.hs
module Lib where
import Control.Monad (replicateM)
someFunc :: IO ()
someFunc = undefined
a, b, m :: Int
a = 179
b = 239
View boost_voronoi.cpp
#include <algorithm>
#include <iostream>
#include <vector>
#include <boost/polygon/voronoi.hpp>
using namespace std;
using boost::polygon::voronoi_diagram;
using boost::polygon::voronoi_builder;
using boost::polygon::construct_voronoi;
@vasalf
vasalf / comparable.cpp
Created Dec 6, 2019
Практика 12
View comparable.cpp
#include <iostream>
#include <memory>
class Comparable {
public:
virtual int compareTo(const Comparable& other) const = 0;
};
class Int : public Comparable {
int value;
@vasalf
vasalf / auto_ptr.cpp
Created Dec 6, 2019
Практика 11
View auto_ptr.cpp
#include <iostream>
struct point {
int x, y;
point() {
std::cout << "Construct " << this << std::endl;
}
~point() {
@vasalf
vasalf / Makefile
Created Dec 6, 2019
Внутренний приватный класс
View Makefile
all: main
bin:
mkdir bin
bin/aclass.o: src/aclass.cpp | bin
g++ -c -g -Iinclude -std=c++11 src/aclass.cpp -o bin/aclass.o
bin/main.o: src/main.cpp | bin
g++ -c -g -Iinclude -std=c++11 src/main.cpp -o bin/main.o
@vasalf
vasalf / integer_set.cpp
Created Nov 24, 2019
Практика 10
View integer_set.cpp
#include <iostream>
#include <vector>
#include <algorithm>
class integer_set {
public:
using const_iterator = std::vector<int>::const_iterator;
integer_set() { }
@vasalf
vasalf / vector.cpp
Created Nov 8, 2019
Практика 8
View vector.cpp
#include "vector.h"
vector_int::vector_int() {
size_ = 0;
capacity_ = 16;
data_ = new int[capacity_];
}
void vector_int::reserve(size_t new_size) {
if (new_size <= capacity_)
@vasalf
vasalf / expat.c
Created Oct 18, 2019
Практика 7
View expat.c
#include <stdio.h>
#include <stddef.h>
#include <expat.h>
#define UNUSED(x) (void)(x)
#ifdef XML_UNICODE_WCHAR_T
# include <wchar.h>
# define XML_FMT_STR "ls"
#else
View 01_cli.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[]) {
printf("argc: %d\n", argc);
for (int i = 0; i < argc; i++) {
printf("argv[%d]: %s\n", i, argv[i]);
}
printf("\n");
@vasalf
vasalf / practice.c
Created Oct 12, 2019
Практика 5': Упражнения на указатели
View practice.c
void task1() {
int x = 179;
int* p = &x;
int** n = malloc(sizeof(int*));
}
/*
Какой тип у выражений?
1. p
You can’t perform that action at this time.