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 <vector> | |
#include <list> | |
#include <map> | |
#include <set> | |
#include <deque> | |
#include <stack> | |
#include <bitset> | |
#include <algorithm> | |
#include <functional> | |
#include <numeric> |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle, required | |
Plugin 'gmarik/Vundle.vim' |
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 | |
from __future__ import print_function | |
import csv | |
import sys | |
import datetime | |
from tqdm import tqdm | |
import importlib | |
import re | |
from decimal import Decimal |
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
tell application "iTunes" | |
play | |
delay 25*60 | |
pause | |
dispaly dialog "You need a break" | |
end tell |
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 argparse | |
arg_parser = argparse.ArgumentParser() | |
def time_argument(func): | |
def _(*args, **kwargs): | |
arg_parser.add_argument('-b', '--begin_time', nargs='?', default=None, help='begin time, use yesterday if omit') | |
arg_parser.add_argument('-e', '--end_time', nargs='?', default=None, help='end time, use next day of begin_time if omit') | |
return func(*args, **kwargs) | |
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
# coding: utf-8 | |
from __future__ import print_function | |
import subprocess | |
import sys | |
import argparse | |
def main(): | |
parser = argparse.ArgumentParser() | |
mut_group = parser.add_mutually_exclusive_group() |
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
// It need push_back postlist by order, so record pl_map[i] = pl, then push them orderly. | |
std::map<int, PostList *> pl_map; | |
std::vector<std::thread> vt; | |
std::mutex mutex; | |
auto start = std::chrono::high_resolution_clock::now(); | |
for (size_t i = 0; i != leaves.size(); ++i) { | |
vt.push_back(std::thread([this, first, maxitems, start, &total_subqs, &pl_map, &definite_matches_not_seen, &mutex](size_t ii) { | |
PostList *pl = leaves[ii]->get_postlist(this, &total_subqs); | |
if (false && is_remote[ii]) { // use localmutltimatch, so don't go here | |
if (pl->get_termfreq_min() > first + maxitems) { |