Skip to content

Instantly share code, notes, and snippets.

View yuantuo666's full-sized avatar
๐Ÿ˜ถโ€๐ŸŒซ๏ธ
Sleeping

Chaoren Wang yuantuo666

๐Ÿ˜ถโ€๐ŸŒซ๏ธ
Sleeping
View GitHub Profile
@yuantuo666
yuantuo666 / draw_iclr_dist.py
Created November 12, 2025 15:25
Draw ICLR scores distribution.
#!/usr/bin/env python3
"""
Single-figure visualization for paper-level mean rating bins (0.5 width) with stacked counts by rating std category (COLORED).
Data source: https://github.com/papercopilot/paperlists
What this script does:
- Reads a JSON file (NOT JSONL). The JSON is expected to be either:
* a list of paper objects, or
* a single paper object, or
@yuantuo666
yuantuo666 / untar_fast.py
Last active August 2, 2024 07:05
Unzip large tarfile, not tested!
import tarfile
import os
from multiprocessing import Process, Queue, cpu_count, Manager, Value
import multiprocessing
from tqdm import tqdm
def extract_member(tar_file, member, output_dir, progress, queue):
try:
tar_file.extract(member, path=output_dir)
except Exception as e:
@yuantuo666
yuantuo666 / bb_downloader.js
Last active March 14, 2024 13:40
Paste it in browser console panel to download all files in current Blackboard page.
// https://github.com/ForwardStar/bb_downloader
var url = location.href;
var header = url.match(/https:\/\/\w*.\w*.edu.\w*\//g)[0];
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
var files = xhr.responseText.match(/\/bbcswebdav\/pid-\d*-dt-content-rid-\d*\_\d*\/xid-\d*\_\d*/g);
if (files == null) {
alert("No files detected!");