Skip to content

Instantly share code, notes, and snippets.

View Funmatu's full-sized avatar

Funmatu Funmatu

View GitHub Profile
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vim Neural Map - Visual Cheat Sheet</title>
<style>
:root {
--bg-color: #1a1b26;
--key-bg: #24283b;
@Funmatu
Funmatu / optimization-algorithm-for-maximum-product-of-sequences.ipynb
Created January 4, 2026 05:48
Optimization algorithm for maximum product of sequences.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Funmatu
Funmatu / rust_rayon_vs_numpy_benchmark.ipynb
Last active January 3, 2026 13:41
[Benchmark] NumPy (unstable ~60ms) vs Rust Rayon (stable 10ms). Rust optimization eliminates environment jitter.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -e
# プロジェクト設定
PROJECT_NAME="nx_compute_rs" # Rustのクレート名はスネークケース
REPO_NAME="nx-compute-rs" # リポジトリ名はケバブケース
echo "🚀 Initializing R&D Dual-Runtime Project: $REPO_NAME..."
# ディレクトリ作成
import bpy
import bmesh
import math
import os
import random
import mathutils
# ==========================================
# 設定エリア
# ==========================================
import bpy
import bmesh
import math
import mathutils
import os
# ★Omniverse Connectorがインストールされている場合、オペレーター経由で利用します。
# 直接のimportは環境によってModuleNotFoundErrorになる可能性があるため、
# 実際の処理は bpy.ops.omni... を使用して実装します。
try:
import os
import sys
import argparse
from typing import Tuple
def convert_rpgmvp_to_png(input_path: str, output_path: str) -> None:
"""
単一の.rpgmvpファイルを.pngファイルに変換します。
// (onOpen, showMarpInputDialog_HtmlService, processMarpTextFromDialog は変更なし)
// (parseGlobalDirectives, applyGlobalDirectives, addHeaderFooterToSlide, updatePageNumbers はV5から流用)
// (calculateApproximateHeightV4, applyBoldMarkdownV4, addMarkdownTableToSlide, addHtmlTableToSlide はV6.1のものを流用)
function createSlidesFromMarp(marpText) {
try {
Logger.log('Starting slide generation (Simplified Layout with Tables)...');
const presentation = SlidesApp.create('Generated Marp Presentation - Simplified Tables');
Logger.log(`Presentation created: ${presentation.getName()} (ID: ${presentation.getId()})`);
const globalDirectives = parseGlobalDirectives(marpText);
# letterbox.py
from typing import Tuple, Union
import torch
import torch.nn.functional as F
import kornia
# korniaのワーニングを抑制 (バージョンによっては表示されることがあるため)
import warnings
def letterbox_image(image: Image.Image, target_size: int = 1024) -> Tuple[Image.Image, Tuple[int, int, float]]:
"""アスペクト比を維持してリサイズし、1024x1024にパディングする"""
target_w, target_h = target_size, target_size
iw, ih = image.size
scale = min(target_w / iw, target_h / ih)
new_w, new_h = int(iw * scale), int(ih * scale)
image_resized = image.resize((new_w, new_h), Image.Resampling.LANCZOS)
new_image = Image.new("RGB", (target_w, target_h), (128, 128, 128))