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 argparse | |
import os | |
import glob | |
# pillow | |
from PIL import Image | |
DEST_DIR_NAME = "reshrinked" |
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
/// references between widgets example | |
/// | |
/// ref: https://gtk-rs.org/gtk4-rs/stable/latest/book/g_object_memory_management.html | |
use std::cell::Cell; | |
use std::rc::Rc; | |
use gtk::prelude::*; | |
use gtk::{ | |
glib::{self, clone}, | |
Application, ApplicationWindow, Button, Label, |
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
""" | |
decode vnt file body text into txt file | |
""" | |
import glob | |
import quopri | |
# ref: [RFC1521: 5.1. Quoted-Printable Content-Transfer-Encoding](https://www.ietf.org/rfc/rfc1521.txt) | |
if __name__ == "__main__": |
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
#!/bin/bash | |
# volume$1の内容をvolume$2に(ほぼ完全に)コピーする | |
check_will() { | |
echo "${1}の内容を${2}にコピーします。" | |
echo "2つのvolumeは予め作成されていることを想定しています。" | |
echo "${2}の内容は空であることを想定しています。そうでない場合はどうなるか不明です。" | |
echo -n "本当に実行しますか?(y/n) -> " | |
read will | |
[ $will = "y" -o $will = "yes" ] |
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
#!/bin/bash | |
########################### | |
# | |
# 注意: このスクリプトが存在するフォルダから実行することを前提としている。 | |
# | |
# docker desktop環境に別環境のvolumeを復元する。 | |
# docker desktopにある同名のvolumeは、削除される。 | |
# | |
########################### |
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
#!/bin/bash | |
########################### | |
# | |
# 注意: このスクリプトが存在するフォルダから実行することを前提としている。 | |
# | |
# pwdの場所に | |
# ハードコードされたdocker環境(docker-machineのdefault)の | |
# docker volumeのバックアップを取る。 | |
# |
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
#!/usr/bin/env python3 | |
import timeit | |
import random | |
# ここでは確率的素数判定法を実装する | |
# 確率的素数判定法は合成数かそうではなさそうか判断する。複数回行って、信用性を確保するみたい | |
# まずは、原始的な考えで | |
def way1(num): |
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
# -*- coding: utf-8 -*- | |
""" | |
Flaskを使って、mongodbに保存した画像ファイルを表示させる。 | |
""" | |
# まずはmongoDBのセットアップ | |
from mongoengine import connect |
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
# -*- coding: utf-8 -*- | |
""" | |
Display fft data. | |
Environment: | |
matplotlib==2.0.2 | |
numpy==1.13.0 | |
PyAudio==0.2.11 | |
wxPython==4.0.0a3 |
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
# -*- coding: utf-8 -*- | |
import matplotlib | |
matplotlib.interactive(True) | |
matplotlib.use('WXAgg') | |
import wx | |
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg | |
from matplotlib.figure import Figure |
NewerOlder