Skip to content

Instantly share code, notes, and snippets.

View MSC19950601's full-sized avatar
🤒
Out sick

Ellery Queen MSC19950601

🤒
Out sick
View GitHub Profile
@ayyybe
ayyybe / ccdl.command
Last active January 21, 2025 04:54
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@fanyang89
fanyang89 / npm-taobao-setup.sh
Last active February 22, 2022 03:38
设置淘宝npm
npm config set registry https://registry.npmmirror.com # 注册模块镜像
npm config set disturl https://npmmirror.com/dist # node-gyp 编译依赖的 node 源码镜像
npm config set sass_binary_site https://npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像
npm config set electron_mirror https://npmmirror.com/mirrors/electron/ # electron 二进制包镜像
npm config set puppeteer_download_host https://npmmirror.com/mirrors # puppeteer 二进制包镜像
npm config set chromedriver_cdnurl https://npmmirror.com/mirrors/chromedriver # chromedriver 二进制包镜像
npm config set operadriver_cdnurl https://npmmirror.com/mirrors/operadriver # operadriver 二进制包镜像
npm config set phantomjs_cdnurl https://npmmirror.com/mirrors/phantomjs # phantomjs 二进制包镜像
npm config set selenium_cdnurl https://npmmirror.com/mirrors/selenium # selenium 二进制包镜像
npm config set node_inspector_cdnurl https://npmmirror.com/mirrors/node-inspector # node-inspector 二进制包镜像
@JunhongXu
JunhongXu / download.py
Last active May 12, 2024 15:24
A Python script downloading all ICLR and NIPS papers from openreview.net
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import requests
import os
def download_all_papers(base_url, save_dir, driver_path):
driver = webdriver.Chrome(driver_path)
@soply
soply / disp_multiple_images.py
Last active November 22, 2024 04:48
Plot multiple images with matplotlib in a single figure. Titles can be given optionally as second argument.
import matplotlib.pyplot as plt
import numpy as np
def show_images(images, cols = 1, titles = None):
"""Display a list of images in a single figure with matplotlib.
Parameters
---------
images: List of np.arrays compatible with plt.imshow.
@mcdlee
mcdlee / PETstaging.py
Last active December 29, 2018 13:56
實踐 staging 利用16進位排序
import re
AJCC7 = {
'lung': {
'T': {'x', '0', 'is', '1', '1a', '1b', '2', '2a', '2b', '3', '4'},
'N': {'x', '0', '1', '2', '3'},
'M': {'x', '0', '1', '1a', '1b'}
},
'colon': {
'T': {'x', '0', 'is', '1', '2', '3', '4', '4a', '4b'},
#define __STDC__WANT__LTB__ 1
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<stdint.h>
#define CAP_INCR 10
int main(void)
{
uint64_t *pPrimes=NULL;//定义指针及变量
@karpathy
karpathy / min-char-rnn.py
Last active February 26, 2025 02:03
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
#define __STDC__WANT__LTB__ 1
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<stdint.h>
#define CAP_INCR 10
int main(void)
{
uint64_t *pPrimes=NULL;//定义指针及变量
@GaelVaroquaux
GaelVaroquaux / mutual_info.py
Last active June 18, 2023 12:25
Estimating entropy and mutual information with scikit-learn: visit https://github.com/mutualinfo/mutual_info
'''
Non-parametric computation of entropy and mutual-information
Adapted by G Varoquaux for code created by R Brette, itself
from several papers (see in the code).
This code is maintained at https://github.com/mutualinfo/mutual_info
Please download the latest code there, to have improvements and
bug fixes.
@mcdlee
mcdlee / PET_parsing.py
Last active October 21, 2021 06:22
PET/CT parsing to a Numpy 3D array
import dicom
import os
import numpy
import pylab
# readind data
ds = dicom.read_file("DICOMDIR") # read a dicomdir of PET/CT
# collect pixel_volume and resolution