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 <vector> | |
using std::vector; | |
using std::pair; | |
using std::string; | |
uint8_t pearsonDigits[] = {106, 15, 244, 74, 82, 236, 14, 57, 224, 61, 241, 204, 26, 54, 30, 12, 18, 214, 166, 87, 107, 253, 152, 111, 79, 7, 27, 70, 147, 56, 75, 170, 231, 230, 248, 92, 63, 157, 1, 239, 154, 185, 20, 249, 175, 177, 250, 84, 80, 127, 150, 234, 211, 139, 11, 125, 4, 229, 138, 117, 247, 155, 196, 101, 120, 173, 25, 93, 186, 180, 128, 72, 17, 76, 77, 198, 116, 8, 134, 151, 91, 86, 113, 254, 251, 33, 135, 67, 118, 215, 89, 183, 189, 213, 90, 94, 78, 5, 129, 55, 97, 233, 193, 45, 226, 232, 212, 217, 66, 37, 109, 227, 209, 143, 181, 100, 35, 162, 133, 69, 58, 81, 195, 223, 132, 19, 240, 252, 71, 9, 190, 73, 148, 200, 153, 203, 110, 21, 163, 62, 222, 46, 38, 164, 50, 207, 103, 51, 192, 60, 96, 119, 41, 122, 136, 28, 165, 124, 242, 176, 114, 208, 156, 65, 184, 140, 39, 121, 174, 228, 34, 243, 182, 216, 188, 99, 115, 210, 172, 145, 225, 29, 142, 105, 83, 10, 42, 206, 235, 199, 85, 219, 160, 88, 168, 238, 141 |
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
var FizzBuzz = { | |
'switch': function(N) { | |
var result = []; | |
for (var i = 1; i <= N; i++) { | |
switch (i % 15) { | |
case 0: | |
result.push('FizzBuzz'); | |
break; | |
case 3: |
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 <cstring> | |
#include <fstream> | |
#define MAX_LINE 2048 | |
#define DATA_ALLOC 30000 | |
using namespace std; | |
void fuck(char *start, char *end) { |
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
/* gcc -O2 -Werror -I/usr/include/libpng16 -lpng png.c -o png */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <png.h> | |
typedef struct PNG { | |
int width; | |
int height; | |
int depth; |
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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
typedef struct Node { | |
struct Node *children; | |
size_t child_count; | |
char value; | |
} Node; |
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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#define ARRAY_STRING | |
#if defined ARRAY_STRING | |
#define ARRAY_PRINT "s" | |
typedef char* array_t; | |
#else |
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
.usertext-body pre { | |
margin: 10px 0; | |
color: #f8f8f2 !important | |
} | |
.usertext-body pre, .usertext-body p > code { | |
background: #f7f7f7; | |
border: 1px solid #ccc; | |
-moz-border-radius: 0; | |
-webkit-border-radius: 0; |
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 <cmath> | |
template<typename T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr> | |
bool is_prime(T n) { | |
if (n < 2) { | |
return false; | |
} | |
for (T i = 2, sq = sqrt(n) + 1; i != sq; i++) { | |
if (n % i == 0) { |
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 <stdexcept> | |
struct RangeIterator { | |
int64_t i, s = 1; | |
const RangeIterator &operator++() { | |
i += s; | |
return *this; | |
} | |
const bool operator!=(const RangeIterator &it) { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<style> | |
#canvas { | |
border: 1px solid; |