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 <atomic> | |
#include <iostream> | |
#include <tuple> | |
#include "tmp.hpp" // see http://github.com/zuoyan/tmp | |
template <template <class ...> class F, class ...A> | |
struct tcurry { | |
template <class ...T> | |
struct apply { |
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(CMakeParseArguments) | |
FUNCTION(WEIZI_ABSOLUTE NAME OUT) | |
IF (${NAME} MATCHES "^/") | |
SET(${OUT} ${NAME} PARENT_SCOPE) | |
RETURN() | |
ENDIF() | |
IF ("${CMAKE_SOURCE_DIR}/weizi" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") | |
SET(${OUT} "/${NAME}" PARENT_SCOPE) | |
RETURN() |
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
// Author: Changsheng Jiang(jiangzuoyan@gmail.com) | |
// Public domain. | |
namespace weizi { | |
namespace f256 { | |
inline unsigned char Add(unsigned char a, unsigned char b) { return a ^ b; } | |
inline unsigned char Sub(unsigned char a, unsigned char b) { return 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
#!/bin/env/python | |
# coding: utf8 | |
# | |
# Parse google scholar alerts email, and output a csv file. | |
import re | |
import sys | |
from HTMLParser import HTMLParser | |
import traceback | |
import md5 |
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
// Returns s and e, such that s = T(a + b), and e = (a + b) - s, i.e. s + e = a | |
// + b exactly. | |
template <class T> | |
std::pair<T, T> AddPair(const T& a, const T& b) { | |
auto s = a + b; | |
auto b_v = s - a; | |
auto e = (a - (s - b_v)) + (b - b_v); | |
// auto a_v = s - b_v; | |
// auto b_r = b - b_v; |