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 <SDL2/SDL.h> | |
#include <stdbool.h> | |
struct pt_pair { | |
SDL_Point begin; | |
SDL_Point end; | |
}; | |
int main() { | |
SDL_Init(SDL_INIT_AUDIO); |
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 <array> | |
#include <vector> | |
/* This idea was inspired by how std::tuple<...> is implemented, that is, using std::pair<K, V> | |
* as linked-lists. The same idea here is applied in a different fashion to create multidimensional | |
* std::array<T, N> of homogenous types. A std::vector<T> variant is also made. | |
*/ | |
template<typename T, int N, int ...dims> | |
class ndarray { |
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 <libavformat/avformat.h> | |
#include <libavdevice/avdevice.h> | |
#include <libavutil/avutil.h> | |
static char errbuf[AV_ERROR_MAX_STRING_SIZE]; | |
static void print_streams (int i, int ddev, AVDeviceInfo *d) | |
{ |
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
function objectEqualRecursiveDeep(a, b) { | |
if (a == b) | |
return true; | |
if (typeof a != typeof b) | |
return false; | |
// TODO do something about undefined. | |
if (a == null && b != null || a != null && b == null) | |
return false; |
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> | |
// Chained hashmap. | |
// | |
// TODO Keep load-factor constant | |
// TODO Use union instead of void* | |
struct my_hash_node | |
{ |