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
/* | |
* This is a literate quine. That means that | |
* 1. the comments will tell you a little about how it works and | |
* 2. if you compile and run it its output will be identical to its source | |
* code even though it doesn't look at its original source. It literally | |
* contains within itself a complete recipe for how to display itself. | |
* | |
* Quines are ten a penny. This one is unusual because | |
* 1. its main loop consists solely of a loop to print characters | |
* generated by a function called programChar() and |
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
//aasasddasdas |
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 <map> | |
template<typename T> | |
void ReadAndConsume(std::istringstream& s) | |
{ | |
T t; | |
s >> t; | |
std::cout << t << ' '; |
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> | |
// See https://arxiv.org/abs/2404.01483 | |
long p(long x, long y, long z) | |
{ | |
return x*x*x + 2*x*x*y + x*x*z + 2*x*y*y - 2*x*y*z - x*z*z + 2*y*y*y - 2*y*z*z + z*z*z; | |
} | |
const int N = 505; |
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
data Weird = Weird { a0 :: Integer | |
, a1 :: Integer | |
, a2 :: Integer | |
, a3 :: Integer | |
, a4 :: Integer | |
, a5 :: Integer | |
, a6 :: Integer | |
} deriving Show | |
instance Num Weird where |
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> | |
class Weird { | |
public: | |
float a0, a1, a2, a3, a4, a5, a6; | |
Weird(float b0, float b1, float b2, float b3, float b4, float b5, float b6) | |
: a0(b0), a1(b1), a2(b2), a3(b3), a4(b4), a5(b5), a6(b6) {} | |
Weird operator*(const Weird &other) const { | |
return Weird( |
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 <type_traits> | |
template<typename T, typename U> | |
constexpr bool is_decay_equ = std::is_same_v<std::decay_t<T>, U>; | |
template<typename T> | |
struct MyDecay | |
{ | |
static auto Helper(T 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
# | |
METHOD: TABLE | |
ENCODE: Unicode | |
PROMPT: TeX 1.1 | |
VERSION: 1.1 | |
DELIMITER: , | |
MAXCODE: 6 | |
VALIDINPUTKEY: ^,.?!:;"'/\()[]{}<>$%&@*01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz | |
TERMINPUTKEY: | |
BEGINCHARACTER |
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 <cmath> | |
#include <iostream> | |
#include <numeric> | |
#include <valarray> | |
#include <vector> | |
// Motivated by | |
// Computing the Minimum-Phase filter using the QL-Factorization | |
// Hansen, Morten; Christensen, Lars P.b.; Winther, Ole | |
// https://backend.orbit.dtu.dk/ws/portalfiles/portal/5161145/Hansen.pdf |
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
// See https://www.cs.cmu.edu/~kmcrane/Projects/MonteCarloGeometryProcessing/ | |
// Random numbers using code at | |
// https://stackoverflow.com/a/17479300 | |
// A single iteration of Bob Jenkins' One-At-A-Time hashing algorithm. | |
uint hash( uint x ) { | |
x += ( x << 10u ); | |
x ^= ( x >> 6u ); | |
x += ( x << 3u ); |
NewerOlder