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
PATH := $(PATH) | |
LIBRARY_PATH := $(LIBRARY_PATH) | |
LD_LIBRARY_PATH := $(LD_LIBRARY_PATH) | |
LD_RUN_PATH := $(LD_RUN_PATH) | |
TESTSRCS = $(wildcard test*.cpp) | |
PROJSRCS = $(wildcard project*.cpp) | |
SRCS = $(wildcard *.cpp) | |
SRCS = $(filter-out $(TESTSRCS), $(SRCS)) |
I'm just tired of constant optimization and I wrote this note to show some tricks of optimization. Note: no multithread/coroutine
While keeping the structure of std::vector::resize(reserve, push_back/emplace_back)
and getopt_long
, instead of using dynamic std::string
for storing mode, just using (char*)optarg
and strcmp
and return integer sign to indicate the mode. (It's simple switch (only 3 modes and 2 options), some techniques like place your case index in order and Duff's device are useless.)
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
from urllib.request import urlretrieve | |
import requests | |
from bs4 import BeautifulSoup | |
import sys | |
import os | |
import socket | |
socket.setdefaulttimeout(150) | |
import re | |
class DownloadError: |
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
Originated from http://pdinda.org/Papers/ipdps18.pdf | |
a, b != NaN, a b are floating numbers | |
a + b = b + a ? True | |
a + b + c = a + (b + c) ? False | |
a(b + c) = ab + ac ? False | |
(a + b) - a = b ? False (Inf, rounding) | |
a * a >= 0 ? True (but false for integer arithmetic => overflow) | |
a overflows ? saturation, Inf (integer => wrap-around) | |
a := 1, b := 0, a / b = ? (Inf, will propagate to ordinary numeric) |
OlderNewer