- This index section is only available for structs yet.
- The whole index should be put under the type documentation of a struct in the documentation body, and collapsed by default.
- Auto and blanket trait implementations are not separated from normal traits.
- The
pub
modifier is omitted by default, maybe we can display it when--private-items
flag is enabled. - Trait bounds for generic parameters are omitted
- The type for const generic parameters are omitted.
- Each table is not necessarily rendered as tables in HTML, they can be rendered like the summary of a module, and the headers are not necessary as well.
- We might also add a button on the top right (beside the
[+]
button) for jumping to the index, in case the type documentation is too long.
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, tarfile | |
from subprocess import check_call, DEVNULL | |
from tempfile import mkdtemp, TemporaryDirectory | |
def create_video(tar_path, out_path): | |
with TemporaryDirectory() as tmpd: | |
print("Reading tar:", os.path.basename(tar_path)) | |
tar = tarfile.open(tar_path, "r:gz") | |
tar_members = tar.getmembers() | |
front_camera_imgs = [member for member in tar_members if member.name.split('/')[-2] == "rgb_front"] |
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/env python | |
"""This script is modified from PythonAPI/examples/generate_traffic.py and PythonAPI/examples/automatic_control.py""" | |
from __future__ import print_function | |
import argparse | |
import collections | |
import datetime | |
import glob |
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 sys, os, binascii | |
from imohash import hashfile | |
from pathlib import Path | |
from tqdm import tqdm | |
from collections import defaultdict | |
from time import time | |
from hashlib import md5 | |
USE_HASH = True |
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 | |
from pathlib import Path | |
FACTOR_PATH = "progress_factor.csv" | |
MORE_FACTOR_PATH = "more_factors.csv" | |
def expect_b1(exp, mem): | |
# https://www.mersenneforum.org/showthread.php?t=27477 | |
import math | |
base = 2.2**math.log2(20000000/exp)*1000000 |
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 ubuntu:18.04 | |
USER root | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update ; \ | |
apt-get install -y wget software-properties-common && \ | |
add-apt-repository ppa:ubuntu-toolchain-r/test && \ | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add - && \ | |
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" && \ |
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/env python3 | |
import os | |
import rosbag | |
from cv2 import VideoWriter, VideoWriter_fourcc | |
from cv_bridge import CvBridge | |
import argparse | |
class RosbagVideoReader: | |
def __init__(self, args) -> None: |
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
wsl --shutdown | |
diskpart :: opening a separate window | |
select vdisk file="C:\Users\{user}\AppData\Local\Packages\…\ext4.vhdx" | |
attach vdisk readonly :: this step is necessary to prevent process conflict | |
compact vdisk | |
detach vdisk | |
exit |
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 math, random | |
def lgcd(x, y): | |
if x < y: | |
return lgcd(y, x) | |
shift = max(x.bit_length() // 64, y.bit_length() // 64) | |
xbar = x >> (shift * 64) | |
ybar = y >> (shift * 64) | |
while y > 2**64: |
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
//! Benchmarking GCD algorithms on primitive integers | |
//! | |
//! Time consumption with my test (on a 64bit system): | |
//! u32 : gcd_bin < gcd_bin_bfree < gcd_bin_compact < gcd_euclid; gcd_euclid_ext < gcd_bin_ext; | |
//! u64 : gcd_bin_compact < gcd_bin_bfree < gcd_bin < gcd_euclid; gcd_euclid_ext < gcd_bin_ext; | |
//! u128: gcd_bin_compact < gcd_bin_bfree < gcd_bin < gcd_euclid; gcd_euclid_ext < gcd_bin_ext; | |
#[macro_use] | |
extern crate criterion; | |
use criterion::Criterion; |
NewerOlder