Skip to content

Instantly share code, notes, and snippets.

View takahashim's full-sized avatar

Masayoshi Takahashi takahashim

View GitHub Profile
#!/usr/bin/env python3
"""bool のマスクと等価なのは -inf float マスクであって1.0 のそれではない
モデルもチェックポイントも要らないPyTorch だけで完結する
pip install torch
python mask_equivalence.py
`train/README.md` ONNX 変換のために parseq のマスクを
`dtype=torch.bool` から `dtype=torch.float` へ変えるよう指示している

hierarchical_result.json スキーマ分析

(2026/04/06 commit: 53f12097e2d9f4f481ca90b7df2ccee994073a97 )

目的

hierarchical_result.json のスキーマ定義がプロジェクト内でどこに存在し、それぞれが一致しているかを調査した結果をまとめる。


地域Ruby会議のお金の話

takahashim個人のメモです。

そもそもの地域Ruby会議支援の目的について

  • 「日本国内のいろんな地域でRubyとRubyコミュニティが盛り上がってほしい!」というのが大前提としてあります
    • ITエンジニア向けイベントはなんだかんだといって東京近辺に偏りがちだし
    • RubyKaigiは首都圏から離れて久しいけど年に1回・1箇所でしかできないし
  • とはいえ、Rubyistはすでに各地にいて、普段の活動は各地でいろいろされているはず
--- db/schema.rb 2025-08-07 16:54:14
+++ ../../decidim-cfj/scheme-v30.rb 2025-08-07 17:24:08
@@ -10,9 +10,10 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.0].define(version: 2025_08_07_076037) do
+ActiveRecord::Schema[7.0].define(version: 2025_08_05_081192) do
# These are extensions that must be enabled in order to support this database
enable_extension "ltree"

Decidim Meeting コンポーネントの投票機能

概要

Decidim の Meeting コンポーネントには、ミーティング中にリアルタイムで投票(Poll)を実施する機能が組み込まれています。この機能により、参加者は質問に対してライブで回答することができ、管理者はその結果をリアルタイムで確認できます。

データ構造

主要なモデル

> 質問です。ProposalStateを編集する画面はありますか?ない場合、どうやれば変更できるでしょうか
⏺ ProposalStateを編集する画面について調査します。
⏺ Search(pattern: "proposal_states", path: "../decidim/decidim-proposals", include: "*controller*")
⎿  Found 1 file (ctrl+r to expand)
⏺ Read(../decidim/decidim-proposals/app/controllers/decidim/proposals/admin/proposal_states_controller.rb)
⎿  Read 87 lines (ctrl+r to expand)
@takahashim
takahashim / issue-proposal-state.md
Created June 16, 2025 09:08
decidim bug report 2025-06-16

Bug Report: ProposalState creation fails with non-ASCII default locale

Description

When the default locale is set to a non-ASCII language (such as Japanese :ja), the create_default_states! method in decidim-proposals fails to create ProposalState records. This prevents proposal components from having the necessary states (evaluating, accepted, rejected), making proposal answering functionality unavailable in the admin interface.

The issue occurs because the generate_token method in ProposalState cannot properly handle non-ASCII characters in titles when generating tokens, and it incorrectly processes symbol tokens passed from create_default_states!.

Steps to Reproduce

Re:VIEW AST導入計画

概要

Re:VIEWの内部アーキテクチャを、現在の直接Builder呼び出し方式から、共通のAST(抽象構文木)を経由する方式に段階的に変更する計画です。

現在の構造

Re:VIEW文書 → Compiler → Builder(各フォーマット) → 出力
ransack.search: 検索
ransack.predicate: は以下である
ransack.and: と
ransack.or: あるいは
ransack.any: いずれか
ransack.all: 全て
ransack.combinator: 組み合わせ
ransack.attribute: 属性
ransack.value: 値
ransack.condition: 状態
diff -uwbNr decidim-cfj/config/application.rb decidim/development_app/config/application.rb
--- decidim-cfj/config/application.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/application.rb 2023-08-21 23:24:55
@@ -1,37 +1,22 @@
-# frozen_string_literal: true
-
require_relative "boot"
-require "decidim/rails"
-# Add the frameworks used by your app that are not loaded by Decidim.