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
| """ZIPファイルの中身を検査するスクリプト""" | |
| import sys | |
| import zipfile | |
| def main(path_input_zip): | |
| """メイン処理""" | |
| # 出力ファイル名を決定 --- (※1) | |
| path_output_zip = path_input_zip + ".fixed.zip" | |
| with zipfile.ZipFile(path_input_zip, 'r') as zin: | |
| with zipfile.ZipFile(path_output_zip, 'w', zipfile.ZIP_DEFLATED) as zout: |
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 std::fs::File; | |
| use std::io::{BufRead, BufReader}; | |
| use std::error::Error; | |
| fn main() -> Result<(), Box<dyn Error>> { | |
| // 対象CSVファイルを開いてバッファ付きリーダーで巻き取る --- (*1) | |
| let file = File::open("utf_ken_all.csv")?; | |
| let reader = BufReader::new(file); | |
| // 住所カナや郵便番号・住所を一時保存する構造体を蓄積 --- (*2) |
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
| """ 太陽フレア情報を画像で配信するWebサーバー """ | |
| from datetime import datetime, timedelta | |
| from io import BytesIO | |
| from pathlib import Path | |
| import requests | |
| from PIL import Image, ImageDraw, ImageFont | |
| from flask import Flask, send_file, redirect | |
| # NASA API キー (以下を書き換えてください) --- (*1) | |
| NASA_API_KEY = "DEMO_KEY" |
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 base64 | |
| from openai import OpenAI | |
| import typer | |
| # 画像生成用のプロンプトテンプレート --- (*1) | |
| PROMPT_TEMPLATE = """\ | |
| 指示: {prompt} | |
| 画風: {style} | |
| """ |
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
| 都道府県 | 店舗数 | |
|---|---|---|
| 北海道 | 8321 | |
| 青森県 | 1632 | |
| 岩手県 | 2746 | |
| 宮城県 | 4337 | |
| 秋田県 | 1830 | |
| 山形県 | 2143 | |
| 福島県 | 5106 | |
| 茨城県 | 6371 | |
| 栃木県 | 4626 |
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
| 都道府県 | 人口_千人 | |
|---|---|---|
| 北海道 | 5043 | |
| 青森県 | 1165 | |
| 岩手県 | 1145 | |
| 宮城県 | 2248 | |
| 秋田県 | 897 | |
| 山形県 | 1011 | |
| 福島県 | 1743 | |
| 茨城県 | 2806 | |
| 栃木県 | 1885 |
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
| 都道府県 | 計 | |
|---|---|---|
| 北海道 | 11559 | |
| 青森県 | 3015 | |
| 岩手県 | 3807 | |
| 宮城県 | 8319 | |
| 秋田県 | 3593 | |
| 山形県 | 6193 | |
| 福島県 | 11415 | |
| 茨城県 | 14477 | |
| 栃木県 | 10380 |
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 sounddevice as sd | |
| import numpy as np | |
| import librosa | |
| import blessed | |
| import sys | |
| import queue | |
| import time | |
| from scipy.signal import butter, sosfilt_zi, sosfilt | |
| # --- 定数 --- |
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 std::env; | |
| use std::fs; | |
| use std::io::Read; | |
| use std::path::Path; | |
| use anyhow::{Context, Result}; | |
| use xlsxwriter::Workbook; | |
| fn main() -> Result<()> { | |
| let args: Vec<String> = env::args().collect(); | |
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 | |
| import TkEasyGUI as eg | |
| # 定数の宣言 | |
| CANVAS_SIZE = (800, 600) # キャンバスのサイズ | |
| MOSAIC_SIZE = 5 # モザイクのサイズ | |
| # グローバル変数 | |
| is_mouse_down = False | |
| start_xy = (0, 0) |
NewerOlder