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
# pip install pillow | |
# ref: https://tat-pytone.hatenablog.com/entry/2021/12/22/202936 | |
from PIL import Image | |
# 画像の読み出し | |
im1 = Image.open('input/tsuzuri1.jpg') | |
im2 = Image.open('input/nankyoku.jpg') | |
im2 = im2.resize((960, 1165)) | |
# グリーンバックの画像をHSV変換 |
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
use String; | |
use std::io; | |
fn calc_day_of_weeks(date: i32) -> i32{ | |
let year = date / 10000; | |
let month = date % 10000 / 100; | |
let year_fixed = if month < 3 {year - 1} else {year}; | |
let month_fixed = if month < 3 {month + 12} else {month}; | |
let year_bottom = year_fixed % 100; |
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
{ | |
"footer":"なのよ", | |
"comment":"/* 識別子 複数対応, 先頭のみ対応,応答間隔, 判定文字, 返信文字群 */", | |
"ohayou": [ true, false, 480, "おはよう|起床|オハヨウ|こんにち(わ|は)", ["おはようなのよ","おはおはなのよ","おはようご>ざいますなのよ"] ], | |
"tadaima":[ false, false, 30, "ただいま|帰宅($|。|し(まし)*た($|。))",["おかえりなのよ", "おかえりなさいなのよ"]], | |
"otukare":[ false, false, 10, "(疲|つか)れた|タスケテ|助けて|悲しい|つらい",["おつかれさまなのよ","あともうちょっと、>なのよ。","私が見守ってるのよ","元気出して、なのよ♪"]], | |
"chucchu":[ false, false, 0, "甘えたい|ちゅっ",["にゃ〜","にゃん♪","ふん、なのよ。"]], | |
"gacha":[ false, false, 10, "ガチャ|ガシャ", ["まわし過ぎには注意なのよ", "天井まで行った?なのよ", "ガチャは悪い文明なのよ"]], | |
"nanya":[ false, false, 10, "なんや!", ["なんやとはなんなのよ!", "なんやとはなんなのよ!"]], | |
"sate":[ false, false, 40, "さて", ["さて?", "さて?"]], |
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
% rustc hello.rs -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib |
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
from PIL import Image, ImageDraw | |
images = [] | |
before = 20 | |
frames = 30 + 1 | |
after = 20 | |
s = (0xff, 0xff) | |
e = (0x8e, 0x00) |
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
autoload -Uz compinit | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' formats '(%s:%b)' | |
zstyle ':vcs_info:*' action formats '(%s:%b|%a)' | |
precmd (){ | |
psvar=() | |
LANG=en_US.UTF8 vcs_info | |
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_" | |
} | |
compinit |
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
親が二年前に亡くなったけど、その次の自分の誕生日近くに、おばから母から預かった手紙を渡された |
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
# sys.argvのlenに関しては(本当は良くないけど)今回は割愛 | |
import sys | |
filename = sys.argv[1] | |
with open(filename) as f: | |
lines = f.readlines() | |
cnt = 0 | |
for l in lines: | |
print(cnt, l.rstrip("\n")) | |
cnt += 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 random | |
aqours = ["千歌", "梨子", "果南", "ダイヤ", "曜", "善子", "花丸", "鞠莉", "ルビィ"] | |
def check(combi): | |
if set(combi) == ("千歌", "果南") or \ | |
set(combi) == ("善子", "曜") or \ | |
set(combi) == ("ダイヤ", "ルビィ") or \ | |
set(combi) == ("花丸", "鞠莉", "梨子"): |
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 random | |
days = random.randint(1,101) | |
action = random.choice(["死ぬ", "生きる", "結婚する", "食べる", "進化する", "辞職する", "産卵する"]) | |
target = random.choice(["ワニ", "カエル"]) | |
text = "%s日後に%s%s" % (days, action, target) | |
print(text) |
NewerOlder