Skip to content

Instantly share code, notes, and snippets.

View resetius's full-sized avatar

Alexey Ozeritskiy resetius

View GitHub Profile
@resetius
resetius / poly.cpp
Created June 25, 2024 19:46
polynomial expansion in Polish notation
#include <algorithm>
#include <fstream>
#include <vector>
#include <string>
#include <iostream>
#include <unordered_map>
#include <assert.h>
using namespace std;
@resetius
resetius / process-vga-pallette.php
Created October 3, 2023 22:35 — forked from cesarmiquel/process-vga-pallette.php
VGA 256 Color Palette to RGB
<?php
$im = imagecreatefrompng("vga-palette.png");
$sx = (int) 800 / 16;
$sy = (int) 800 / 16;
$ox = (int) ($sx / 2);
$oy = (int) ($sx / 2);
for($y = 0; $y < 16; $y++) {
for($x = 0; $x < 16; $x++) {
$rgb = imagecolorat($im, $sx*$x + $ox, $sy*$y + $oy);
#include <stdio.h>
int perevod(char *s)
{
int code[256];
int i = 0;
int N = 0;
for (i = 0;i < 256; i ++) {
code[i] = 0;
}
#include <vector>
#include <tbb/enumerable_thread_specific.h>
class A;
class B {
public:
//std::vector<std::vector<A> > b; // <- can be compiled both g++ and cl
tbb::enumerable_thread_specific<std::vector<A> > b; // <- fails on cl
~B();