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
#!/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 |
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
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 二进制包镜像 |
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 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) |
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 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. | |
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 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'}, |
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
#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;//定义指针及变量 |
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
""" | |
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) |
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
#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;//定义指针及变量 |
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
''' | |
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. |
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 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 |
NewerOlder