This file contains 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 os, sys | |
for path in sys.path: | |
if os.path.isdir(path): | |
print(f"{path}") | |
for child in os.listdir(path): | |
full_child_path = os.path.join(path, child) | |
if os.path.isdir(full_child_path) and not child.endswith("-info"): | |
print(f"{child}", end=", ") | |
print() | |
print() |
This file contains 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
javascript: (function () { | |
/** | |
* @param root{HTMLElement} | |
* @param idxlist{Number[]} | |
* @returns {HTMLElement} | |
*/ | |
function digChild(root, idxlist) { | |
if (!idxlist.length) return root; | |
var next_idxlist = [...idxlist]; | |
var i = next_idxlist.shift(); |
This file contains 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 bs4 import BeautifulSoup | |
from pathlib import Path | |
from dataclasses import dataclass | |
from tqdm import tqdm | |
from datetime import datetime | |
import re | |
from collections import defaultdict | |
@dataclass | |
class Article: |
This file contains 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
N = 8; | |
K = 4; | |
% (k,i,j) = 時刻k-1→kでの,j→iの遷移度数 | |
T_data = rand(K, N, N) | |
%% 遷移度数表データを視覚化する | |
fig = figure(Name="Transition Counts Strength"); | |
hold on; | |
xlabel("Time k"); ylabel("State Index i"); |
This file contains 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
/* | |
PushAndSurvive | |
使用ボード | |
ネコボード | |
遊び方 | |
シリアルモニターを用意し、ボーレートを1200に合わせます。 | |
電源を入れると、シリアルモニターにストーリーが流れてきます。 | |
いいタイミングの時に、ネコボードのボタンを押してください。 |
This file contains 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
N = 1e8 | |
x_s = 1:N; | |
aho_flag_list = zeros(1,N); | |
%% xが3の倍数であればアホ | |
tic | |
aho_flag_list(3:3:N) = 1; | |
toc |
This file contains 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
function scenechanging | |
%% | |
fig = uifigure; | |
l = uigridlayout(fig,[3 2]); | |
maincontainer = uipanel(l); | |
maincontainer.Layout.Column = [1 2]; | |
maincontainer.Layout.Row = [1 3]; | |
s1_button = uibutton(l); | |
s1_button.Text = "1"; |
This file contains 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
function okaerinasai | |
%% | |
fig = uifigure; | |
fig.Name = "MATLAB GUI Test"; | |
%% | |
layout = uigridlayout(fig,[2 2]); | |
%% | |
greeting_label = uilabel(layout); | |
greeting_label.Text = "お帰りなさい,あなた.何にする?"; | |
greeting_label.HorizontalAlignment = "right"; |
This file contains 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 | |
from pathlib import Path | |
from matplotlib import pyplot as plt | |
def add_grid(image: Image.Image, d: int) -> Image.Image: | |
width, height = image.size | |
new_image = Image.new("RGB", (width+d, height+d), (255, 255, 255)) | |
new_image.paste(image, (0, 0)) | |
draw = ImageDraw.Draw(new_image) |
This file contains 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 { useState } from "react"; | |
export default (defaultValue, ms) => { | |
const [value, setValue] = useState(defaultValue); | |
const [timeoutHandler, setTimeoutHandler] = useState(null); | |
const mySetValue = (newValue) => { | |
setValue(newValue); | |
if (timeoutHandler) clearTimeout(timeoutHandler); | |
setTimeoutHandler( | |
setTimeout(() => { | |
setValue(defaultValue); |
NewerOlder