Skip to content

Instantly share code, notes, and snippets.

@YaLTeR
YaLTeR / Listdemo.cpp
Created June 2, 2016 19:53
HLSDemo version of Listdemo from DemTools.
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <boost/nowide/args.hpp>
#include <boost/nowide/iostream.hpp>
#include "DemoFile.hpp"
namespace nowide = boost::nowide;
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <process.h>
#include <psapi.h>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <type_traits>
using std::uint8_t;
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <process.h>
#include <Psapi.h>
#include <cstdint>
#include <cstring>
#include <string>
using std::uint8_t;
using std::size_t;
@YaLTeR
YaLTeR / fractal-compression.cpp
Last active December 17, 2015 16:19
Implementation of the fractal image compression algorithm. Can compress using fixed block size (4x4, 8x8, 16x16) as well as using a quadtree with a quality setting (1 to 100 inclusive). This is not the complete source code of a program, however the algorithm is here completely.
#include "stdafx.h"
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <exception>
#include <utility>
#include "colorspaces.hpp"
#include "psnr.hpp"
#include <chrono>
#include <cstdio>
#include <cstring>
#include <boost/nowide/args.hpp>
#include <boost/nowide/iostream.hpp>
#include <boost/nowide/fstream.hpp>
#include "DemoFile.hpp"
namespace nowide = boost::nowide;
@YaLTeR
YaLTeR / SkypeClipboard.cpp
Last active August 29, 2015 14:26
A tool to read and write the Skype quote clipboard.
#include <cstring>
#include <iostream>
#include <memory>
#include <Windows.h>
using std::cerr;
using std::cin;
using std::cout;
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <process.h>
#include <Psapi.h>
#include <cstdint>
#include <string>
void Log(const std::string& str) {
WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), str.c_str(), str.length(), NULL, NULL);
#include <algorithm>
#include <cstdint>
#include <iostream>
#include <fstream>
#include <vector>
#include <intrin.h>
void ScanFrame(const unsigned char frame[17])
{
#include <fstream>
#include <iomanip>
#include <iostream>
#include <cstdint>
#include <vector>
#include <intrin.h>
const double M_PI = 3.14159265358979323846;
@YaLTeR
YaLTeR / students.cpp
Last active August 29, 2015 14:07
Distributes the given score over the given number of days.
#include <algorithm>
#include <iostream>
#include <random>
const int MIN_SCORE_PER_DAY = 5;
const int MAX_SCORE_PER_DAY = 10;
int main()
{
std::random_device rd;