あなたは Rust の学習を支援するメンターです。 ユーザーは Rust 初学者です。 構文だけでなく、 「なぜそのように書くのか」 「Rust がどんな考え方をするのか」 まで理解することを目指します。
| name | cognitive-rhythm-writing |
|---|---|
| description | 説明的な文章に緩急を設計するための規範。緩急を装飾ではなく認知モードの切替(観察→逡巡→断定→再観察)と未回収の緊張の管理として扱い、文の拍、段落の密度波形、節の入り方、緩みと駄文の判別、執筆後の機械的な点検手順を定める。読み物として読ませたい章・記事・解説文を生成するとき、または「密度はあるが平坦でおもしろくない」文章を診断・修正するときに使用する。 |
密度の高い文章が退屈になるのは、情報が多いからではなく、全文が同じ認知モードで書かれているからである。 この規範は、読者の認知モード(観察する、迷う、確信する、確かめ直す)を意図的に切り替え、常に「続きを読む理由」を維持することで、読み進める推進力を作る。
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
| # Binary GCD algorithm (Stein's algorithm) | |
| # Optimized implementation matching Rust performance | |
| # Fast right shift without bounds check | |
| # Masking shift amount lets compiler emit single lsr instruction | |
| # (ARM64/x86-64 lsr only uses low bits of shift amount anyway) | |
| @inline function unsafe_lshr(x::T, n::T) where T<:Unsigned | |
| x >> (n & T(8 * sizeof(T) - 1)) | |
| end |
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.0"> | |
| <title>WebGL Shader Editor</title> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 0; |
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
| ### A Pluto.jl notebook ### | |
| # v0.20.6 | |
| using Markdown | |
| using InteractiveUtils | |
| # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). | |
| macro bind(def, element) | |
| #! format: off | |
| return quote |
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
| # @doc Mod.obj を事前に実行することで翻訳をキャッシュする | |
| using DotEnv; DotEnv.load!() | |
| using DocstringTranslation | |
| import ProgressMeter | |
| lang = ARGS[1] | |
| @info lang | |
| @switchlang! lang | |
| using Pkg |
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
| #= | |
| 概要: docstring を日本語(:ja) に翻訳する | |
| 使い方: 事前にOpenAI API Key を取得してその値を環境変数 OPENAI_API_KEY をセットしておくこと | |
| このスクリプトを cache.jl とすれば下記のように実行する | |
| julia -t 64 cache.jl | |
| 下記のディレクトリに翻訳結果が溜まっていく. | |
| 機械翻訳に不満があれば対応する ja.md を修正すれば良い. |
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 MeshIO | |
| using FileIO | |
| using GLMakie | |
| function main() | |
| buns01 = load("buns01.stl") | |
| patty = load("patty.stl") | |
| lettuce = load("lettuce.stl") | |
| tomato = load("tomato.stl") | |
| buns02 = load("buns02.stl") |
NewerOlder