| Description | Command |
|---|---|
| Start a new session with session name | screen -S <session_name> |
| List running sessions / screens | screen -ls |
| Attach to a running session | screen -x |
| Attach to a running session with name | screen -r <session_name> |
This file contains hidden or 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 -S uv run --with matplotlib --python 3.12 python | |
| """ | |
| D-screen artifact for [[note-us-treasury-debt]] §12 (yield curve + inversion). | |
| Self-contained & reproducible: fetches → computes → plots. The PNG is a | |
| disposable output (gitignored binary); THIS SCRIPT is the durable artifact. | |
| DATA SOURCE (provenance) | |
| US Treasury — Daily Treasury Par Yield Curve Rates (authoritative; not FRED). | |
| Endpoint (CSV, per calendar year, no API key): |
This file contains hidden or 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 | |
| """ | |
| Simulation comparing AIMD (TCP-style) vs Martingale gambling strategies. | |
| """ | |
| import random | |
| from dataclasses import dataclass | |
| from typing import List, Tuple | |
| @dataclass |
This file contains hidden or 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 | |
| from glob import glob | |
| from tqdm import tqdm | |
| dir_root = '/mnt/SSD_1/ge_noncancer'.replace('/', os.path.sep) | |
| fn_lis = glob(os.path.join(dir_root, '**', '*.png'), recursive=True) | |
| for fn in tqdm(fn_lis): |
This file contains hidden or 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
| def iou(boxes1, boxes2): | |
| """ | |
| Arguments: | |
| boxes1 (numpy.array): [[x_min, y_min, x_max, y_max]] [N, 4] | |
| boxes2 (numpy.array): [[x_min, y_min, x_max, y_max]] [M, 4] | |
| Returns: | |
| ious (numpy.array): 2D array shape of [N, M] | |
| """ | |
| N, M = len(boxes1), len(boxes2) | |
| assert N > 0 |
This file contains hidden or 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 | |
| import os, sys | |
| import shutil | |
| from glob import glob | |
| def move_all_out(dir_root): | |
| fn_lis = glob(os.path.join(dir_root, '*', '*')) | |
| for fn in fn_lis: | |
| # move out |
This file contains hidden or 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
| mkdir ~/.pip | |
| cat <<EOF > ~/.pip/pip.conf | |
| [global] | |
| trusted-host = mirrors.aliyun.com | |
| index-url = http://mirrors.aliyun.com/pypi/simple | |
| EOF |
This file contains hidden or 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
| { | |
| name: "nih_chest_xray" | |
| description: "ChestX-ray dataset comprises 112,120 frontal-view X-ray images of 30,805 unique patients with the text-mined fourteen disease image labels (where each image can have multi-labels), mined from the associated radiological reports using natural language processing. Fourteen common thoracic pathologies include Atelectasis, Consolidation, Infiltration, Pneumothorax, Edema, Emphysema, Fibrosis, Effusion, Pneumonia, Pleural_thickening, Cardiomegaly, Nodule, Mass and Hernia, which is an extension of the 8 common disease patterns listed in our CVPR2017 paper. Note that original radiology reports (associated with these chest x-ray studies) are not meant to be publicly shared for many reasons. The text-mined disease labels are expected to have accuracy >90%.Please find more details and benchmark performance of trained models based on 14 disease labels in our arxiv paper: 1705.02315" | |
| citation: "@InProceedings{wang2017chestxray,author = {Wang, Xiaosong and Peng, Yifan and Lu, Le an |
This file contains hidden or 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
| mkdir ~/src | |
| wget https://www.python.org/ftp/python/3.4.10/Python-3.4.10.tgz | |
| tar -zxvf Python-3.4.10.tgz | |
| cd Python-3.4.10 | |
| mkdir ~/.localpython | |
| ./configure --prefix=$HOME/.localpython | |
| make | |
| make install | |
This file contains hidden or 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
| """ | |
| 强迫症老板和他的洗碗工(10分) | |
| 题目内容: | |
| 洗碗工小明碰上了一位强迫症老板老王,餐厅一共就10只盘子, | |
| 老板给仔细编上了0~9等10个号码,并要求小明按照从0到9的编号来洗盘子, | |
| 当然,每洗好一只盘子,就必须得整齐叠放起来。 | |
| 小明洗盘子期间,经常就有顾客来取盘子,当然每位顾客只能从盘子堆最上面取1只盘子离开。 | |
| 老王在收银台仔细地记录了顾客依次取到盘子的编号,比如“1043257689”, | |
| 这样他就能判断小明是不是遵照命令按照0123456789的次序来洗盘子了。 | |
| 你也能像老王一样作出准确的判断吗? |
NewerOlder