Skip to content

Instantly share code, notes, and snippets.

@tell
tell / .gitignore
Last active December 30, 2015 06:38
join in C++
*.o
test_*
*.log
@tell
tell / Makefile
Last active September 5, 2015 15:40
Excersize of ZMQ and MessagePack
CXXFLAGS = -std=c++11
LDLIBS = -lzmq
TARGETS = hwserver hwclient
all: $(TARGETS)
clean:
$(RM) $(TARGETS)
@tell
tell / .gitignore
Last active August 29, 2015 14:24
An exercise for C99
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
@tell
tell / .gitignore
Last active August 29, 2015 14:19
Apple clang 6.1.0 for C++
hoge_*
@tell
tell / Makefile
Last active October 8, 2015 15:06
Atomic vs Mutex
CC = $(CXX)
CPPFLAGS += -std=c++11 -pthread -O3 -I$(HOME)/include -I../xbyak
BOOST_SUFFIX =
WORKAROUND_LDLIBS =
ifeq ($(shell uname -s),Darwin)
BOOST_SUFFIX = -mt
endif
ifneq (,$(findstring Linux,$(shell uname -s)))
# See http://stackoverflow.com/questions/22593658/compiling-multithread-code-with-g-wl-no-as-needed-not-working
# and https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201
@tell
tell / BorringSSL on Core i7 3630QM
Last active August 22, 2016 07:17
Benchmarking implementations of SSL/TLS: OpenSSL, LibreSSL, and BoringSSL
Core i7 3630QM (2.4 GHz, 4 physical cores)
Mac OS X 10.9.4
Variable CPU clock is enabled.
$ git log | head -1
commit 55bbdb71b68bc085e1542d682b618733afbba7f0
$ ./bssl speed
Did 2668 RSA 2048 signing operations in 3024997us (882.0 ops/sec)
@tell
tell / Makefile
Last active August 29, 2015 14:00
CilkPlus sample
GCC_VERSION := $(shell $(CXX) -dumpversion)
GCC_MAJOR_VERSION = $(shell echo $(GCC_VERSION) | cut -d '.' -f 1)
GCC_MINOR_VERSION = $(shell echo $(GCC_VERSION) | cut -d '.' -f 2)
CPPFLAGS = -Wall -Wextra -O3 -g3 -fcilkplus
LDFLAGS = -g3 -lcilkrts -lgmpxx -lgmp -lstdc++
TARGETs = fib
.PHONY: all clean precheck
@tell
tell / sage
Last active December 19, 2015 12:29
#!/bin/sh
if [ -n "$PYTHONPATH" ]; then
echo WARNING: unset PYTHONPATH 1>&2
unset PYTHONPATH
fi
SAGE_ROOT=/path/to/directory/of/sage
$SAGE_ROOT/sage "$@"
@tell
tell / EventCall.java
Created September 28, 2012 23:50
Forwarding Events
package com.github.gist._3802655;
public interface EventCall <LISTENER> {
public void addListener(LISTENER listener);
public void removeListener(LISTENER listener);
}
@tell
tell / gmp.java
Created May 20, 2012 10:14
GMP Wrapper by JNA, but this code is broken
package com.github.tell.gmp;
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.github.tell.gmp.JNAGMP.GMPLib.mpz_struct;
import com.sun.jna.Library;
import com.sun.jna.Native;