Skip to content

Instantly share code, notes, and snippets.

View psqq's full-sized avatar
🙃
Where is my mind?

Sergey Pestov psqq

🙃
Where is my mind?
View GitHub Profile
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
template <class EventType>
class Observer {
public:
virtual ~Observer() {}
virtual void onNotify(const EventType &event) = 0;
#include <iostream>
#include <vector>
using namespace std;
class Process {
public:
virtual bool isPause() = 0;
virtual bool isDone() = 0;
virtual void tick() = 0;
};
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
struct Event {
Event(int akey, int ach) : key(akey), ch(ach) {}
typedef unsigned char byte;
struct Bitset {
size_t data_size, count_bits, count_sets;
byte *data;
Bitset() : data_size(0), count_bits(0), count_sets(0), data(NULL) {}
~Bitset() { if (data != NULL) delete[] data; }
void setSize(size_t n) {
if (data != NULL) delete[] data;
count_bits = n;
# Continued fraction
import fractions as F
def to_cf(n, m):
res = []
g = F.gcd(n, m)

tar xvjf archive.tar.bz2

// https://repl.it/CCAm/2
"use strict";
var map =
`.....
.....
.###.
.....
.....`.split("\n");
C-h t -- Туториал
C-h k -- Объяснит комбинацию клавишь
C-h w -- Объяснит команду
# SLIME
C-c C-] -- slime-close-parens-at-point
import itertools as it
import sys
N = 40
x, y = 22, 30
c = 0
def partitions(n):
if n == 0: