Skip to content

Instantly share code, notes, and snippets.

@YaLTeR
YaLTeR / Main.java
Last active December 22, 2015 17:49
HurtEntitiesTester plugin source
package hetester;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
@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;
#include <fstream>
#include <iomanip>
#include <iostream>
#include <cstdint>
#include <vector>
#include <intrin.h>
const double M_PI = 3.14159265358979323846;
#include <algorithm>
#include <cstdint>
#include <iostream>
#include <fstream>
#include <vector>
#include <intrin.h>
void ScanFrame(const unsigned char frame[17])
{
#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);
@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;
#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 / 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"
#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;
#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;