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
// file: src/main.rs | |
use std::io; | |
use lazyrand::{shuffle, randint}; | |
const JOKER: u8 = 52; // ジョーカーは52番 | |
const CARD_SUIT: [&str; 5] = ["♠", "♥", "♣", "♦", ""]; // カードのマーク | |
const CARD_NUMS: [&str; 14] = [ // カードの数字ラベル | |
"Jok", "A", "2", "3", "4", "5", "6", | |
"7", "8", "9", "10", "J", "Q", "K"]; |
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
年月日 | 平均気温 | |
---|---|---|
2015/6/1 | 23.1 | |
2015/6/2 | 22.9 | |
2015/6/3 | 21.2 | |
2015/6/4 | 22.6 | |
2015/6/5 | 19.1 | |
2015/6/6 | 18.1 | |
2015/6/7 | 20.7 | |
2015/6/8 | 20.7 | |
2015/6/9 | 19.5 |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 10 in line 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
ダウンロードした時刻:2025/06/02 14:44:27 | |
,横浜,横浜,横浜,横浜,横浜,横浜,横浜,横浜,横浜 | |
年月日,平均気温(℃),平均気温(℃),平均気温(℃),最高気温(℃),最高気温(℃),最高気温(℃),最低気温(℃),最低気温(℃),最低気温(℃) | |
,,,,,,,,, | |
,,品質情報,均質番号,,品質情報,均質番号,,品質情報,均質番号 | |
2015/6/1,23.1,8,1,28.0,8,1,20.7,8,1 | |
2015/6/2,22.9,8,1,27.7,8,1,19.7,8,1 | |
2015/6/3,21.2,8,1,22.4,8,1,20.3,8,1 | |
2015/6/4,22.6,8,1,29.1,8,1,18.9,8,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 sys | |
from janome.tokenizer import Tokenizer | |
# 形態素解析のためのTokenizerのインスタンスを生成 | |
tokenizer = Tokenizer() | |
# 接続詞の一覧 | |
setuzokusi = set() | |
def check_text(text): |
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::collections::HashMap; | |
use lazyrand; | |
use mnist_reader::MnistReader; | |
/// 決定木のノードを表します。 | |
enum Node { | |
Leaf { prediction: u8 }, | |
Decision { | |
feature_index: usize, | |
threshold: f32, |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1" /> | |
<!-- PyScriptのライブラリを取り込み --> | |
<link rel="stylesheet" href="https://pyscript.net/releases/2025.3.1/core.css"> | |
<script type="module" src="https://pyscript.net/releases/2025.3.1/core.js"></script> | |
<title>PyScriptでライフゲーム</title> | |
</head> |
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 random import randint | |
from PIL import Image, ImageEnhance, ImageOps, ImageFilter, ImageDraw | |
from pillow_heif import register_heif_opener | |
import TkEasyGUI as eg | |
# HEICが読めるように登録 | |
register_heif_opener() | |
# 画像オブジェクトにセピアフィルタを適用する |
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 image::{GenericImageView, imageops::FilterType}; | |
use std::fs; | |
use std::env; | |
// 画素に対応するASCII文字を指定 | |
const ASCII_CHARS: &[u8] = b"@#%8&o*=+-:. "; | |
// RGB値を256色ANSIカラーコードに変換 | |
fn rgb_to_ansi256(r: u8, g: u8, b: u8) -> u8 { | |
let r_idx = (r as u16 * 5 / 255) as u8; |
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::collections::HashMap; | |
use std::fs; | |
use regex::Regex; | |
use vibrato::{Dictionary, Tokenizer}; | |
use lazyrand; | |
use std::io::{self, Write}; | |
// 特殊な単語IDを定義 | |
static TOP_WORD_ID: isize = 0; | |
static END_WORD_ID: isize = 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 os | |
import smtplib | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
from glob import glob | |
# Gmailのアカウント情報を環境変数から読み取る --- (*1) | |
GMAIL_ACCOUNT = os.environ['GMAIL_ACCOUNT'] | |
GMAIL_PASSWORD = os.environ['GMAIL_PASSWORD'] | |
EMAIL_UPLOAD_TO = os.environ["EMAIL_UPLOAD_TO"] |
NewerOlder