This file contains hidden or 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 | |
| { |
This file contains hidden or 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 setEqual(a, b) { | |
| for (var i = 0; i < a.length; ++i) | |
| if (b.indexOf(a[i]) === -1) | |
| return false; | |
| for (var i = 0; i < b.length; ++i) | |
| if (a.indexOf(b[i]) === -1) | |
| return false; | |
| return true; |
This file contains hidden or 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 hidden or 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 hidden or 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_VIDEO); |
NewerOlder