Skip to content

Instantly share code, notes, and snippets.

View Colk-tech's full-sized avatar
🤒
Always sick

ITO Manaki (Colk) Colk-tech

🤒
Always sick
View GitHub Profile
@Colk-tech
Colk-tech / haracho_arch.py
Created February 9, 2021 14:53
@approver のはらちょBOT様DiscordBOTの雛形です
import os
import discord
class MainClient(discord.Client):
def __init__(self, token: str):
intents = discord.Intents.all()
intents.members = True
super(MainClient, self).__init__(presences=True, guild_subscriptions=True, intents=intents)
@Colk-tech
Colk-tech / prime_factorization.py
Created January 18, 2021 09:55
学校の情報理論の副産物です。整数をできるだけ大きい2つの素数に分解します。
from typing import Tuple
from sympy import sieve
def prime_factorization(n: int) -> Tuple[int, int]:
if n < 0:
raise RuntimeError("Invalid number has passed. Please specify number in the range: 1~")
first_factor = find_greatest_factor(n)
@Colk-tech
Colk-tech / 10_3_test_cases.txt
Last active January 3, 2021 20:42
学校の実験で使った結合テスト用のテストケース
A B C D Y
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 1 0
0 0 0 1 0
0 0 0 1 0
0 0 0 1 0
0 0 1 0 0
@Colk-tech
Colk-tech / config.yml
Created December 18, 2020 16:21
Minecraftのサーバープラグインであるclear lagのメッセージ日本語化
#--------------------------------------------------------------------#
# ClearLag Configuration File #
#--------------------------------------------------------------------#
# Configure to your liking, reload the config by tying: /lagg reload #
# - #
# Here is a helpful tutorial on this configuration setup! (Updated) #
# http://dev.bukkit.org/bukkit-plugins/clearlagg/pages/config-setup/ #
#--------------------------------------------------------------------#
# All possible mob names: https://goo.gl/cch8YK #
#--------------------------------------------------------------------#
@Colk-tech
Colk-tech / messages.yml
Created December 18, 2020 16:14
Minecraftのサーバープラグインである1vs1のメッセージ日本語化
alreadyInQueue: '&cYou are already in the queue of arena &6{ARENA}&a. Number: &6{NUMBER}'
notInQueue: '&cYou are not in a queue'
leaveQueue: '&aYou left the queue of arena &6{ARENA}'
joinQueue: '&aYou are in the queue of arena &6{ARENA} &anow. Number: &6{NUMBER}'
setSpawn1: '&6Spawn 1 &asuccessfully set in arena &6{ARENA}'
setSpawn2: '&6Spawn 2 &asuccessfully set in arena &6{ARENA}'
winAnnounce: '&c{WINNER} &abeat &2{LOSER} &ain arena &6{ARENA}'
winAnnounce: '&c{WINNER} &abeat &2{LOSER} &ain arena &6{ARENA}'
alreadyInArena: '&cYou are already in the arena &6{ARENA}'
reload: '&aConfiguration reloaded!'
@Colk-tech
Colk-tech / configmsg.yml
Created December 18, 2020 16:07
MinecraftのサーバープラグインであるAuto Save Worldのメッセージ日本語化
broadcast:
pre: '&9セーブします...'
post: '&9セーブが完了しました'
broadcastbackup:
pre: '&9バックアップします...'
post: '&9バックアップが完了しました'
broadcastpurge:
pre: '&9データをパージします...'
post: '&9データのパージが完了しました'
autorestart:
@Colk-tech
Colk-tech / Keybase Proof
Created December 5, 2020 10:23
Keybase Proof
### Keybase proof
I hereby claim:
* I am colk-tech on github.
* I am colk_ (https://keybase.io/colk_) on keybase.
* I have a public key ASCiTdC5yZ5DC-LOng8lJnsPfIf1gcS4WEQ-kK7yOLCk2go
To claim this, I am signing this object:
@Colk-tech
Colk-tech / questioner.py
Created November 12, 2020 09:19
@isso0424 くんの化学のやつにバリデート機能をつけたパッチです (isso0424/vs_chemistry_weapon)
"""
Question interprinter
"""
from src.types.question import Question
class Questioner:
"""
Question proposing interprinter
"""
@Colk-tech
Colk-tech / yubisuma.c
Created November 5, 2020 05:56
授業のために作ったかなりクソコードな指スマです
int main(void) {
int is_cpu_turn;
int default_fingers;
int game_end_flag = 0;
int user_left_fingers;
int user_raise_fingers;
int user_declared_number;
int cpu_left_fingers;
@Colk-tech
Colk-tech / average_information_content.py
Created October 8, 2020 06:53
授業で即興で書いた平均情報量を求めるやつです
import math
def amount_of_information(expectation_value: float, probability: float) -> float:
retval = expectation_value * math.log2(1.0/probability)
return retval
events = {"sunny": 0.40, "cloudy": 0.30, "rainy": 0.30}