find *.zip -exec sh -c 'echo $1 | cut -f 1 -d '.'' _ {} \; | xargs -L 1 sh -c 'mkdir $1; unzip $1.zip -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
import json | |
import re | |
import shutil | |
import subprocess | |
from pathlib import Path | |
ext_dir = Path("/root/.vscode-server/extensions") | |
patterns = [ | |
r"ms-python\.isort-\d{4}\.\d{1,2}\.\d{1,2}", |
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 torch as th | |
def gaussian_filter_nd(dims, r, sig): | |
grid = th.linspace(-1, 1, r) | |
grid = th.stack(th.meshgrid([grid for _ in range(dims)], indexing="xy"), dim=-1) | |
return th.exp(-grid.square().sum(dim=-1) / 2 / sig**2) / ((2 * th.pi)**0.5 * sig) ** dims |
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 math | |
import os | |
import random | |
import re | |
import shutil | |
import time | |
from collections import OrderedDict | |
from datetime import datetime | |
from pathlib import Path |
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 one_hot(index, classes): | |
index = index.view(-1, 1) | |
mask = torch.zeros(index.size(0), classes) | |
mask.scatter_(1, index, 1.0) | |
return mask |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 seed_everything(seed=1234): | |
random.seed(seed) | |
os.environ['PYTHONHASHSEED'] = str(seed) | |
np.random.seed(seed) | |
torch.manual_seed(seed) | |
torch.cuda.manual_seed(seed) | |
torch.backends.cudnn.deterministic = True | |
seed_everything() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Edit /etc/rc.local
sudo chmod +x /etc/rc.local
Update /lib/systemd/system/rc-local.service
[Service]
Type=forking
일반적으로 IBUS로 키보드를 셋팅했을 때, 한영전환을 ALT_R, 한자 전환을 CONTROL_R 로 하는 경우가 많은데, 크롬에서는 이 ALT_R를 한영전환이 아니라 있는 그대로 ALT_R로 받아들이기 때문에 한영전환이 안 되는 것. 왜 크롬이 그렇게 작동하는지는 잘 모르겠다.
해결 방법은 아래 명령어를 실행하면 된다. ALT_R과 CONTROL_R의 키 맵을 변경하는 것.
xmodmap -e "remove mod1 = Alt_R"
xmodmap -e "keycode 0x6c = Hangul"
NewerOlder