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 <locale> | |
#include <codecvt> | |
#include <string> | |
#include <iostream> | |
#include <gtest/gtest.h> | |
template <typename CharT, typename F> | |
int FilteredCompare(const CharT *lb, const CharT * const le, | |
const CharT *rb, const CharT * const re, |
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
struct MeteringIterator: public std::iterator<std::output_iterator_tag, void, void, void, void> { | |
public: | |
MeteringIterator(size_t *times_ptr) noexcept : | |
times(times_ptr) { | |
*times = 0; | |
} | |
template <typename T> | |
MeteringIterator& operator= (T &&elem) noexcept { | |
++*times; |
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/bash | |
set -e | |
if [ $# -eq 0 ]; then | |
echo "USAGE: $0 plugin1 plugin2 ..." | |
exit 1 | |
fi | |
plugin_dir=. |
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
#! /usr/bin/python | |
#coding:utf-8 | |
import time | |
import sys | |
import getopt | |
import os | |
def PrintHelpAndExit() : | |
print "Usage: %s -f path -p pid -t time" % (sys.argv[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
import ( | |
"os" | |
"github.com/satori/go.uuid" | |
) | |
func UniqueFile(dir, prefix string, flags int, perm os.FileMode) (f *os.File, err error) { | |
unique_file_prefix := dir + "/" + prefix | |
flags |= os.O_EXCL | os.O_CREATE |
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 ( | |
"os" | |
"github.com/satori/go.uuid" | |
"github.com/williamsandrew/go-xchg" | |
"golang.org/x/sys/unix" | |
) | |
func UniqueRename(oldpath, newpath_dir, newpath_prefix string) (newpath string, err error) { |
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
GCC := gcc | |
GXX := g++ | |
project_path := $(shell pwd) | |
BIN := | |
C_SRC := | |
CXX_SRC := | |
CFLAGS := |
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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"time" |
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
# coding: utf-8 | |
import os | |
import sys | |
import logging | |
logging.basicConfig(format="%(asctime)s|%(process)d|%(thread)d|%(name)s|%(levelname)s|%(message)s", level=logging.INFO) | |
def opened_info(path): |
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
# coding=utf-8 | |
import traceback | |
import sys | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
logger = logging.getLogger('test') |
OlderNewer