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
| int doCheck(int check) { | |
| switch (check) { | |
| case TYPE_1: | |
| return afterCheck(); | |
| case TYPE_2: | |
| return afterCheck(); | |
| default: | |
| return 0; |
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 <iostream> | |
| #include <vector> | |
| #include <memory> | |
| class A { | |
| public: | |
| A() {} | |
| A(int i) { | |
| std::cout << i << std::endl; | |
| } |
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
| -- A easy to use multiple-return-value is equivalent of having | |
| -- an automatic packing & unpacking mechanism of the functions' | |
| -- input & output. | |
| function mv(n) | |
| if n == 0 then | |
| return | |
| else | |
| return n, mv(n - 1) | |
| end |
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 <sys/random.h> | |
| #include <lauxlib.h> | |
| static int l_getrandom(lua_State *L) { | |
| luaL_Buffer B; | |
| size_t d = lua_tointeger(L, 1); /* get argument */ | |
| char *buf = luaL_buffinitsize(L, &B, d); | |
| int len = getrandom(buf, d, 0); | |
| luaL_pushresultsize(&B, len); |
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
| local iter = 0 | |
| if #arg < 1 then | |
| error("Input number of iterations") | |
| else | |
| iter = tonumber(arg[1]) | |
| end | |
| local rng = io.open("/dev/urandom", "rb") | |
| local sqlite3 = require("lsqlite3") | |
| local db = sqlite3.open("pk_search.db") |
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 <stdint.h> | |
| static inline void print_nums(const uint8_t *u8) | |
| { | |
| for (int i = 0; i < 5; ++i) { | |
| printf(" %d", u8[i]); | |
| } | |
| putchar('\n'); | |
| } |
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 <stdlib.h> | |
| #include <stdbool.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #define JSON_THINGS_SIZE 256 | |
| #define JSON_STRINGS_SIZE 1024 | |
| #define JSON_COMPOUNDS_SIZE 256 |
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 <stdlib.h> | |
| #include <stdbool.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #define JSON_THINGS_SIZE 256 | |
| #define JSON_STRINGS_SIZE 1024 | |
| #define JSON_COMPOUNDS_SIZE 256 |
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 <stdlib.h> | |
| #include <stdbool.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #define JSON_THINGS_SIZE 256 | |
| #define JSON_STRINGS_SIZE 1024 | |
| #define JSON_COMPOUNDS_SIZE 256 |
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 <stdlib.h> | |
| #include <stdbool.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #define JSON_THINGS_SIZE 256 | |
| #define JSON_STRINGS_SIZE 1024 | |
| #define JSON_COMPOUNDS_SIZE 256 |