This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _USE_MATH_DEFINES | |
#include <fstream> | |
#include <cmath> | |
#include <random> | |
#include <map> | |
#include <functional> | |
#include <vector> | |
const double pi = M_PI; | |
const double tau = pi * 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <string> | |
#include <random> | |
#include <iostream> | |
#include <ctime> | |
const char *first_names = "AMBER.ARMORED.ASHEN.ASSASSIN.BASTARD.BITING.BITTER.B" | |
"LACK.BLAZING.BLOODY.BLUE.BRASS.BRUTAL.BULLET.CANNIBAL.CHARGING.CODE.COPPER.CRA" | |
"WLING.CREEPING.CRIMSON.CRYING.CRYSTAL.CUNNING.DANCING.DARK.DEATH.DEVIL.DIRE.DI" | |
"ZZY.DOOM.EMERALD.FIRE.FLAMING.FRANTIC.FRIGID.GARNET.GLACIER.GOBLIN.GOLDEN.GRAY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <optional> | |
#include <sstream> | |
#include <stdexcept> | |
#include <functional> | |
#include <Windows.h> | |
typedef std::function<bool(HWND)> enumerate_windows_cb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MemoryPage{ | |
uintptr_t base_address; | |
size_t size; | |
bool read; | |
bool write; | |
bool execute; | |
}; | |
std::vector<MemoryPage> list_memory_pages(){ | |
std::vector<MemoryPage> ret; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
void format_size(char *dst, T size){ | |
const char *prefixes[] = { | |
"", | |
"Ki", | |
"Mi", | |
"Gi", | |
"Ti", | |
"Pi", | |
"Ei", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name MoronSilencer | |
// @version 1 | |
// @grant none | |
// @match http://www.cplusplus.com/forum/* | |
// ==/UserScript== | |
console.log('MoronSilencer is working its magic'); | |
var morons = [ /*write the name of your morons here*/ ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <memory> | |
#include <unordered_map> | |
#include <stdexcept> | |
#include <algorithm> | |
#include <cmath> | |
#include <random> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <vector> | |
#include <set> | |
#include <map> | |
#include <queue> | |
#include <stack> | |
#include <cstdlib> | |
#include <cstdio> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Given a range [begin, end) and a T->bool mapping f such that | |
// map(begin, end, f) gives of any of the following forms: | |
// * [true, ..., true] | |
// * [false, ..., false, true, ..., true] | |
// * [false, ..., false] | |
// Then find_first_true(begin, end, f) returns the first iterator such that | |
// f(*iterator), or end if it does not exist. | |
// In other words, given a sorted range [begin, end), | |
// the range [begin(begin, end, (>= x)), begin(begin, end, (> x))) | |
// is equivalent to the subrange of [begin, end) that is equal to x. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <SD.h> | |
#include <SoftwareSerial.h> | |
#include <EEPROM.h> | |
#include <Arduino.h> // for type definitions | |
int EEPROM_writeInt(int ee, int value){ | |
byte *p = (byte *)(void *)&value; | |
unsigned i; | |
for (i = 0; i < sizeof(value); i++) |
NewerOlder