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
## method | |
disable line no / file name logging: comment out line 10~13 in `index.js` | |
benchmark use `gocannon`: ./gocannon http://localhost:3000 -d 10s -c 50 | |
## summary | |
without: 3495 req/s | |
with: 3204 req/s | |
perf cost: ~8.3% | |
## without line no / file name logging |
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
原帖:https://bgm.tv/group/topic/375970 | |
TLDR:本 gist 试图找出深圳地铁图上的最长环 | |
新算法运行说明 | |
1. 把 `metroStationsList.js` 里的站点信息单独存储成一个 `all_lines.json` | |
2. 运行 `prepare_graph.py` | |
3. 运行 `find_graphillion.py` | |
4. 运行 `decode_result.py` | |
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
public class PyItertoolPermutation { | |
public static void main(String[] args) { | |
char[] arr = {'A', 'B', 'C', 'D'}; | |
int r = 2; | |
dfs(0, arr, r); | |
} | |
public static void dfs(int changing_idx, char[] arr, int r) { | |
if (changing_idx == r){ |
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
# WARNING: NOT QUITE WORKING... | |
import sys | |
import subprocess | |
import bisect | |
from pathlib import Path | |
def run_command(command_list): | |
success = True |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 json | |
import toml | |
from pdftocgen.recipe import extract_toc, Recipe | |
from fitzutils import ToCEntry, dump_toc, open_pdf | |
from pdftocio.tocio import write_toc | |
# requiremnets | |
# ---------------------------- | |
# ruquire `pdf.tocgen` | |
# https://github.com/Krasjet/pdf.tocgen |
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
<!DOCTYPE html> | |
<html lang="cmn-Hans"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello!</title> | |
<style id="dark-mode-theme" disabled> | |
html { | |
background-color: #ebebeb !important; | |
} | |
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
# Note | |
# some codepoints you might want to remove: | |
# u+00a9: copyright | |
# u+00ae: registered | |
# Regex | |
(\u00a9|\u00ae|\u203c|\u2049|\u20e3|\u2122|\u2139|[\u2194-\u2199]|[\u21a9-\u21aa]|[\u231a-\u231b]|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\u24c2|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|[\u2600-\u2604]|\u260e|\u2611|[\u2614-\u2615]|\u2618|\u261d|\u2620|[\u2622-\u2623]|\u2626|\u262a|[\u262e-\u262f]|[\u2638-\u263a]|\u2640|\u2642|[\u2648-\u2653]|[\u265f-\u2660]|\u2663|[\u2665-\u2666]|\u2668|\u267b|[\u267e-\u267f]|[\u2692-\u2697]|\u2699|[\u269b-\u269c]|[\u26a0-\u26a1]|\u26a7|[\u26aa-\u26ab]|[\u26b0-\u26b1]|[\u26bd-\u26be]|[\u26c4-\u26c5]|\u26c8|[\u26ce-\u26cf]|\u26d1|[\u26d3-\u26d4]|[\u26e9-\u26ea]|[\u26f0-\u26f5]|[\u26f7-\u26fa]|\u26fd|\u2702|\u2705|[\u2708-\u270d]|\u270f|\u2712|\u2714|\u2716|\u271d|\u2721|\u2728|[\u2733-\u2734]|\u2744|\u2747|\u274c|\u274e|[\u2753-\u2755]|\u2757|[\u2763-\u2764]|[\u2795-\u2797]|\u27a1|\u27b0|\u27bf|[\u2934-\u2935]|[\u2b05-\u2b07]|[\u2b1b-\u2b1c]|\u2b50|\u2b55|\u3030|\u |
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
# as of writing (2021/7/3), here is a list of the version of latest packages (arch=linux64): | |
# tensorflow-gpu: 2.4.0 (anaconda) | |
# cudnn: 8.2.1 (conda-forge) | |
# cudatoolkit: 11.0.221 (anaconda) | |
# step 1: create new conda environment, install python & cudatoolkit | |
conda create -n tf_25_new python=3.8 cudatoolkit=11.0.221 | |
conda activate tf_25_new | |
# step 2: install cudann from conda forge |
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
# source:https://gitee.com/wkc/autogbktoutf8/blob/master/autogbktoutf8.py | |
# requires: chardet | |
# tested on py3, possibly working on py2 | |
#coding=utf8 | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
import os | |
import os.path | |
import codecs |