This is introduction!
- 第1部: まず入門だ!
- 第2部: OOPだ!
- 第3部: ツールの話だ!
- 第4部: サイエンスだ!
.message-group .comment .markup { | |
/* for Japanese language */ | |
/* require IPAexGothic font */ | |
font-family: 'IPAexGothic'; | |
line-height: 1.6; | |
} |
import os | |
import random | |
import numpy as np | |
from discord.ext import commands | |
BOT_PREFIX = ("?", "!") | |
client = commands.Bot(command_prefix=BOT_PREFIX) | |
FROM rocker/rstudio | |
RUN mkdir -p /home/rstudio/.rstudio/monitored/user-settings/ | |
RUN chown -R rstudio:rstudio /home/rstudio/.rstudio |
## フロイドの循環検出法を可視化する ---- | |
library(dplyr) | |
library(igraph) | |
library(ggplot2) | |
library(GGally) | |
library(ggnetwork) | |
#devtools::install_github("dill/emoGG") | |
library(emoGG) | |
make_rho_graph <- function(lambda, mu, type = "network"){ |
" general | |
set autoupdategist " gistの設定を自動反映 | |
let scrollstep = 150 | |
let fullpagescrollpercent = 100 | |
set smoothscroll | |
set noautofocus " サイトを開いた時に入力欄にフォーカスが奪われるのを抑止 | |
let searchlimit = 20 | |
let barposition = "bottom" |
# coding: utf-8 | |
import random | |
def gen_typo(S): | |
return ' '.join( | |
s | |
# 長さ4以下の単語はそのまま返す | |
if len(s) <= 4 | |
# 長さ5以上の単語は1文字目と2文字目を残してシャッフル |
# coding: utf-8 | |
def cipher(S): | |
return ''.join(chr(219 - ord(c)) if c.islower() else c for c in S) | |
S = "abcDe" | |
print(cipher(S)) | |
print(cipher(cipher(S))) |
# coding: utf-8 | |
def n_gram(n, s): | |
return [s[i:i+n] for i in range(0, len(s)-n+1)] | |
print(n_gram(2, 'I am an NLPer')) |
# coding: utf-8 | |
s = 'Hi He Lied Because Boron Could Not Oxidize Fluorine. New Nations Might Also Sign Peace Security Clause. Arthur King Can.' | |
target = 1, 5, 6, 7, 8, 9, 15, 16, 19 | |
result = [w[: 1 if i in target else 2] for i, w in enumerate(s.split(), 1)] | |
print(result) |