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 _G, assert, newproxy, pairs, tostring, type = _G, assert, newproxy, pairs, tostring, type | |
local coroutine_create = coroutine.create | |
local debug_getfenv, debug_gethook, debug_getinfo, debug_getlocal, debug_getmetatable, debug_getregistry, debug_getupvalue, debug_upvalueid, debug_getuservalue = debug.getfenv, debug.gethook, debug.getinfo, debug.getlocal, debug.getmetatable, debug.getregistry, debug.getupvalue, debug.upvalueid, debug.getuservalue | |
local string_byte, string_format, string_gsub, string_match = string.byte, string.format, string.gsub, string.match | |
local where = {} | |
-- Auxiliary functions for finding the n'th key and n'th value in a table. Note | |
-- that the index may be invalidated even if the table is not modified, for | |
-- example if the table is weak | |
function where.nthkey(t, n) |
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
inline void dumpstack(lua_State *L) | |
{ | |
int n = lua_gettop(L); | |
printf(" <%p> Stack dump: %d values\n", L, n); | |
int i; | |
for(int i = 1; i <= n; i++) | |
{ | |
printf(" [%d] ", i); | |
switch(lua_type(L, i)) | |
{ |
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 <stdint.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <sys/mman.h> | |
#define MAX_SHIFT 24 | |
#define REPETITIONS 10 | |
#define ITERATIONS (1 << 20) |
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
diff --git a/lua-5.2.3/src/Makefile b/lua-5.2.3/src/Makefile | |
index 7b4b2b7..efe504b 100644 | |
--- a/lua-5.2.3/src/Makefile | |
+++ b/lua-5.2.3/src/Makefile | |
@@ -103,7 +103,7 @@ freebsd: | |
generic: $(ALL) | |
linux: | |
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" | |
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lpthread" |
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 MEDIUM_TYPE = elem.DEFAULT_PT_BRAY | |
local BLOCK_LENGTH = 19 | |
local SECTOR_LENGTH = 604 | |
local SECTOR_OFFSET = 5 | |
local BLOCK_OFFSET = 4 | |
local SIGNATURE_X = 4 | |
local SIGNATURE_Y = 4 | |
local SIGNATURE_MAGIC = 0xBEEFD1ED |
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
use Irssi; | |
use strict; | |
use bignum; | |
use Socket; | |
use vars qw($VERSION %IRSSI); | |
%IRSSI = | |
( | |
name => "isbanned", | |
description => "freenode-specific module that checks whether someone is banned on some channel", |
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
module Lambda ( | |
Lambda(..), | |
($$), | |
lambda, | |
lambdaEnv, | |
annotate, | |
fromInt, | |
toInt, | |
fromBool, | |
toBool, |
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 <stdint.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define error(...) (printf(__VA_ARGS__), exit(EXIT_FAILURE)) | |
struct node_s | |
{ | |
int type; |
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
data Combinator = Id | Join | Const | Flip | Lift Combinator | Compose [Combinator] deriving (Eq,Show) | |
reorder src dst = reCompose $ optimize $ deCompose $ trans src dst | |
where | |
trans src [] = nullify src | |
trans src dst = Compose [trans src $ init dst, findAndMove src $ last dst] | |
nullify [] = Id | |
nullify (_:xs) = Compose [Const, nullify xs] | |
findAndMove [] c = error "Not found" | |
findAndMove (x:xs) c |
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
IN=in.c | |
LINKER=in.T | |
OUT=out | |
all: | |
gcc -Os -fPIC -o $(OUT) $(IN) -ggdb -nostdlib -T $(LINKER) -fno-asynchronous-unwind-tables -Wl,-z,max-page-size=4096 | |
strip $(OUT) | |
strip -R .comment $(OUT) |