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
CFLAGS=-O2 -ffast-math -march=native | |
CXXFLAGS=$(CFLAGS) | |
ifneq (, $(findstring 64, $(shell uname -m))) | |
asm_file=prime64.S | |
x86_64=1 | |
else | |
asm_file=prime32.S | |
endif |
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
import Data.List | |
import Graphics.Gloss | |
import Graphics.Gloss.Data.Point | |
infixl 6 |+| | |
(x, y) |+| (x', y') = (x + x', y + y') | |
spiral = scanl (|+|) (0, 0) steps | |
where |
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
expr :: String -> (Double, String) | |
expr s = expr1 x rest where (x, rest) = term s | |
expr1 lhs ('+' : s) = expr1 (lhs + x) rest where (x, rest) = term s | |
expr1 lhs ('-' : s) = expr1 (lhs - x) rest where (x, rest) = term s | |
expr1 lhs s = (lhs, s) | |
term s = term1 x rest where (x, rest) = factor s | |
term1 lhs ('*' : s) = term1 (lhs * x) rest where (x, rest) = factor s | |
term1 lhs ('/' : s) = term1 (lhs / x) rest where (x, rest) = factor s | |
term1 lhs s = (lhs, s) | |
factor ('(' : s) = (x, rest) where (x, ')' : rest) = expr s |
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 <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#define BUF_SIZE 1048576 |
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 <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/ioctl.h> | |
#include <net/if.h> | |
#include <netinet/in.h> |
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> | |
struct B; | |
struct A | |
{ | |
struct B *ptr; | |
}; | |
struct 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
CFLAGS=-O2 | |
CXXFLAGS=-O2 | |
all: parser | |
parser.cpp: parser.rl | |
ragel -G2 $^ -o $@ | |
parser.o: parser.cpp RawQuote.h |
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
// line 1 "Lexer.rl" | |
public class Lexer { | |
// line 19 "Lexer.rl" | |
// line 10 "Lexer.java" | |
private static byte[] init__simple_lexer_actions_0() |
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
CXXFLAGS=-O2 -Wall -g -fPIC $(shell pkg-config --cflags lua5.1 luabind) -I/usr/local/include/bullet | |
LDFLAGS=-lstdc++ $(shell pkg-config --libs lua5.1 luabind) -lLinearMath | |
all: luavector | |
luavector: luavector.o | |
luavector.o: luavector.cpp | |
.PHONY: clean |
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 <errno.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
OlderNewer