$ sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev
$ sudo apt update
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
# Windows 10 disable Cortana & enable UTC time | |
1. WIN + R, REGEDIT | |
2. HKEY_LOCAL_MACHINE > SOFTWARE > Policies > Microsoft > Windows, New > Key, "Windows Search", New > DWORD (32-bit) Value. Type in AllowCortana, and hit enter. | |
3. cmd; Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_QWORD /d 1 |
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
let a = [ | |
{ | |
width: 0, | |
height: 1 | |
}, | |
{ | |
width: 2, | |
height: 3 | |
}, | |
] |
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
// 实现 Promise.allConcurrent | |
// Promise.allConcurrent(2)([()=>fetch('BLAH1'), ()=>fetch('BLAH2'),...()=>fetch('BLAHN')]) | |
// 先同时执行 BLAH1、BLAH2,BLAH1 执行完毕之后立即开始执行 BLAH3,以此类推…… | |
Promise.allConcurrent = n => list => promiseAllStepN(n, list) | |
/** | |
* 带并发数限制的 Promise.All | |
* @param {*} n 同时并发数 | |
* @param {*} list 需要执行的 Promise 列表 | |
*/ |
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
//Open the DICOMDIR File | |
QString DICOMDIR_folder = "C:/Folder1/Folder2"; | |
const char *fileName = "C:/Folder1/Folder2/DICOMDIR"; | |
DcmDicomDir dicomdir(fileName); | |
//Retrieve root node | |
DcmDirectoryRecord *root = &dicomdir.getRootRecord(); | |
//Prepare child elements | |
DcmDirectoryRecord *rootTest = new DcmDirectoryRecord(*root); | |
DcmDirectoryRecord *PatientRecord = NULL; | |
DcmDirectoryRecord *StudyRecord = NULL; |
~/.zshrc
:
# proxy list
# https://zhuanlan.zhihu.com/p/47849525
# https://zhuanlan.zhihu.com/p/153124468
# 注意不 export 的话,别的 bash 脚本是访问不到这个变量的,为了能在 .ssh/config 访问到,必须 export 一下
# https://unix.stackexchange.com/a/495163
export host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ")
# wget 比较特殊,不认 all_proxy,只认 http_proxy 和 https_proxy
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
```bash | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
``` |
参考 element plus,很巧妙地使用动态类型定义,同时使用 ExtractPropTypes
得到静态类型。
packages/components/radio/src/radio.ts
:
// buildProps 的实现比较复杂,可以直接拿来使用就行了,就是对类型做了优化,有了静态类型类似 `PropType<string>`
export const radioPropsBase = buildProps({
size: useSizeProp,
disabled: Boolean,
label: {
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
const fs = require('fs') | |
const path = require('path') | |
const move = (a, b) => { | |
console.log(`moving from ${a} to ${b}`) | |
// return | |
fs.renameSync(a, b) | |
} | |
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
# Test saving speed of different data format | |
import numpy as np | |
import pickle | |
import nibabel as nib | |
import time | |
from os import path | |
import SimpleITK as sitk | |
a = np.empty((512, 512, 512)) |
OlderNewer