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
from threading import Timer | |
def chained(iterable, delay = 1.0, groupSize = 10): | |
def anon(arr, size, *args, **kwargs): | |
inc = kwargs["increment"] if "increment" in kwargs else 10 | |
start = kwargs["start"] if "start" in kwargs else 0 | |
finish = kwargs["finish"] if "finish" in kwargs else inc | |
if (finish >= size): |
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 BUFFER_INIT 32 | |
typedef struct SerializedBuffer | |
{ | |
void* data; | |
size_t index; |
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
#define CHUNK_SIZE 256 | |
#define MAX_CHUNKS 4 | |
/** | |
* Homemade readline. Dynamically read input. | |
* | |
* @param prompt The text to prefix the user's input with | |
* @param line Assigned the value of the user's input if not NULL | |
* | |
* @return The size of the read input | |
*/ |
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
typedef enum BOOL | |
{ | |
false = 0, | |
true = 1 | |
} bool; | |
/** | |
* Tokenize a string using a custom separator and obey tags (such as chevrons or double quotes) | |
* | |
* When finished, remember to free each entry and then the array itself |
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
local function iterstr(str) | |
return str:gmatch(".") | |
end | |
local function count(obj) | |
local x = 0 | |
for k, v in pairs(obj) do | |
x = x + 1 | |
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
local function explode(str, separator) | |
local out = {} | |
for w in str:gmatch("([^" .. separator .. "]+)") do out[#out + 1] = w end | |
return out | |
end | |
local 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
-- Convenience function to explode some text | |
local function explode(str, separator) | |
local out = {} | |
for w in str:gmatch("([^" .. separator .. "]+)") do out[#out + 1] = w end | |
return out | |
end | |
local defaultComp = function(a, b) return a > b 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
-- Convenience function to explode some text | |
local function explode(str, separator) | |
local out = {} | |
for w in str:gmatch("([^" .. separator .. "]+)") do out[#out + 1] = w end | |
return out | |
end | |
function table.swap(t, a, b) |
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
-- Convenience function to explode some text | |
local function explode(str, separator) | |
local out = {} | |
for w in str:gmatch("([^" .. separator .. "]+)") do out[#out + 1] = w end | |
return out | |
end | |
Node = {} |
NewerOlder