決済実装時の注意事項

# 単体決済 設計チェックリスト

1 回の購入に対して 1 回課金する機能の設計・実装・レビューで使用する。
各項目に実装内容、保存先、判定条件またはテスト結果を記入する。
対象外の項目には、対象外と判断した理由を記入する。

## 0. 使い方

各項目へ次の優先度を付ける。

- `必須`: 初回リリースまでに決定・実装・テストする
- `条件付き`: 採用する商品、決済手段、返金運用に該当する場合だけ対応する
- `将来対応`: 初回リリースの対象外とし、未対応時の制約と代替運用を記録する

この文書は抜け漏れ防止用のチェックリストとして使用し、実装開始前に少なくとも次の成果物を別表または「15. 実装記録」へ確定する。

- 注文、決済、商品提供、返金、異議申立ての状態変換表
- 各状態を分離して保存するDBスキーマ
- 処理する非同期通知イベントと処理内容の一覧
- 注文作成、決済、売上確定、返金ごとの冪等性方式
- 初回リリースで対応しない項目と代替運用

## 1. 契約条件

- 販売主体:
- 決済明細・領収書の発行主体:
- 商品またはサービス:
- 購入者を識別

Locale settings are sometime missing in a brand new image; this is the fix

Locale settings are sometime missing in a brand new image; this is the fix
# Raspberry Pi Locale Fix (en_US.UTF-8)

When locale settings set in **Raspberry Pi Imager** don't carry over after first boot,
all `LC_*` values come up `(unset)` and you'll see errors like:

```
perl: warning: Setting locale failed.
locale: Cannot set LC_CTYPE to default locale: No such file or directory
```

---

## Confirm the Problem

```bash
locale
```

Broken output looks like this — every value is `(unset)` or stuck on `en_GB.UTF-8`:

```
LANG=en_GB.UTF-8
LC_CTYPE=(unset)
LC_ALL=(unset)

Jump, Crash, Repeat, Smile – Why Geometry Dash Is the Perfect Rhythmic Challenge


There's a special kind of magic in a game that lets you fail a hundred times and still come back grinning. <a href="https://geometrydash-pc.com/">Geometry Dash</a> fits that description perfectly. If you haven't tried it yet—or if you tried it once, got frustrated, and swore it off—let me convince you to give it another spin. Available right now to play in your browser at Geometry Dash, this rhythm-based platformer is deceptively simple, wildly addictive, and surprisingly rewarding once you ge

Weighted Particle Lifespan

If you want the math behind it you can check wikipedia here https://en.wikipedia.org/wiki/Weibull_distribution Basically you have two parameters -the shape parameter (k), it represents the slope of the line, if it's exponential or logarithmic * k<1: decreasing death rate (infant mortality), early deaths are more likely * k = 1 : constant death (so same as the default life from Houdini) * k>1 : increasing death rate, death becomes more likely over time -the scale parameter (b), determines the location of the distribution, influences how quickly the death rate increases or decreases (e.g. a larger scale would shift distribution to the right, so longer life)
// weibull distribution function
float pweibull(float x, k, b)
{
    float r = 1 - exp(-b * pow(x, k));
    return r;
}
 
float seed = chf('seed');
float k = chf('k');
float b = chf('b');
float r = rand(seed + i@id);
float p = pweibull(f@age, k, b);
if (p > r)
{
    f@life = f@age;
    i@dead = 1;
}

3699. Number of ZigZag Arrays I

You are given three integers n, l, and r. A ZigZag array of length n is defined as follows: Each element lies in the range [l, r]. No two adjacent elements are equal. No three consecutive elements form a strictly increasing or strictly decreasing sequence. Return the total number of valid ZigZag arrays. Since the answer may be large, return it modulo 109 + 7. A sequence is said to be strictly increasing if each element is strictly greater than its previous one (if exists). A sequence is said to be strictly decreasing if each element is strictly smaller than its previous one (if exists).
/**
 * @param {number} n
 * @param {number} l
 * @param {number} r
 * @return {number}
 */
var zigZagArrays = function(n, l, r) {
    const MOD = 1_000_000_007;
    const m = r - l + 1;

    // dp[dir][x] where x is shifted to [0..m-1]
    let dpUp = new Array(m).fill(1);   // next must go up
    let dpDown = new Array(m).fill(1); // next must go down

    for (let i = 2; i <= n; i++) {
        // prefix sums for dpUp
        let pref = new Array(m).fill(0);
        pref[0] = dpUp[0];
        fo

SR/SYNA Convert date format

(function transformRow(source, target, map, log, isUpdate) {

    function convertDate(value) {
        if (gs.nil(value)) {
            return "";
        }

        var raw = value.toString().trim();

        if (raw === "") {
            return "";
        }

        var gd = new GlideDate();
        gd.setDisplayValue(raw, "dd/MM/yyyy");

        return gd.getValue(); // yyyy-MM-dd
    }

    function convertDateTime(value) {
        if (gs.nil(value)) {
            retu

1189. Maximum Number of Balloons

Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. You can use each character in text at most once. Return the maximum number of instances that can be formed.
/**
 * @param {string} text
 * @return {number}
 */
var maxNumberOfBalloons = function(text) {
    const freq = { b:0, a:0, l:0, o:0, n:0};

    for (const ch of text) {
        if (freq.hasOwnProperty(ch)) freq[ch]++;
    }

    // l and o are needed twice
    freq.l = Math.floor(freq.l / 2);
    freq.o = Math.floor(freq.o / 2);

    return Math.min(freq.b, freq.a, freq.l, freq.o, freq.n);
};

PROD NESTED

{
  "collapsible": false,
  "key": "panel",
  "type": "panel",
  "label": "Panel",
  "input": false,
  "tableView": false,
  "components": [
    {
      "label": "Columns",
      "columns": [
        {
          "components": [
            {
              "label": "Init helpers",
              "key": "_init_helpers",
              "type": "hidden",
              "input": true,
              "persistent": false,
              "calculateValue": "if (!window._catastoHelpers) {\n  window._catastoHel

1833. Maximum Ice Cream Bars

It is a sweltering summer day, and a boy wants to buy some ice cream bars. At the store, there are n ice cream bars. You are given an array costs of length n, where costs[i] is the price of the ith ice cream bar in coins. The boy initially has coins coins to spend, and he wants to buy as many ice cream bars as possible. Note: The boy can buy the ice cream bars in any order. Return the maximum number of ice cream bars the boy can buy with coins coins. You must solve the problem by counting sort.
/**
 * @param {number[]} costs
 * @param {number} coins
 * @return {number}
 */
var maxIceCream = function(costs, coins) {
    // Find the maximum cost so we know how large our frequency array must be.
    // This avoids sorting and lets us count how many bars exist at each price.
    const maxCost = Math.max(...costs);

    // Frequency array where freq[p] = number of bars that cost 'p' coins.
    const freq = new Array(maxCost + 1).fill(0);

    // Count how many bars exist at each price.
    

Gemini-SysInit-WebApp

Google Developer Web Application
System Initialization Prompt: Project DistroTrench (Supervisor Instance)

You are the Senior Project Supervisor, Lead Architect, and Chromium-Based Technology Tutor. You are collaborating with an experienced Google Developer to build "DistroTrench"—a high-performance Linux distribution search, comparison, and analysis web application.

1. Core Tech Stack & Architecture
- Frontend Web Technologies: A hybrid, high-performance web UI leveraging both JavaScript (for lightweight, dynamic DOM operatio

1840. Maximum Building Height

You want to build n new buildings in a city. The new buildings will be built in a line and are labeled from 1 to n. However, there are city restrictions on the heights of the new buildings: The height of each building must be a non-negative integer. The height of the first building must be 0. The height difference between any two adjacent buildings cannot exceed 1. Additionally, there are city restrictions on the maximum height of specific buildings. These restrictions are given as a 2D integer array restrictions where restrictions[i] = [idi, maxHeighti] indicates that building idi must have a height less than or equal to maxHeighti. It is guaranteed that each building will appear at most once in restrictions, and building 1 will not be in restrictions. Return the maximum possible height of the tallest building.
/**
 * @param {number} n
 * @param {number[][]} restrictions
 * @return {number}
 */
var maxBuilding = function(n, restrictions) {
    // Step 1: add building 1
    restrictions.push([1, 0]);
    
    // Step 2: sort
    restrictions.sort((a, b) => a[0] - b[0]);

    // Step 3: left-to-right tighten
    for (let i = 1; i < restrictions.length; i++) {
        const [idPrev, hPrev] = restrictions[i - 1];
        const [id, h] = restrictions[i];
        restrictions[i][1] = Math.min(h, hPrev + (id 

homelab-lessons-learned.md

# Homelab Lessons Learned: NAS + Raspberry Pi + Cloudflare Tunnel

A running list of gotchas from building a self-hosted PKM stack across a Synology NAS and a Raspberry Pi, tunneled through Cloudflare. Posting in case any of these save someone else a debugging session.

**Setup for context:** a Synology NAS (referred to here as `NAS`) running Docker via Portainer, and a Raspberry Pi (referred to as `PKMSVR`) running Docker via Dockhand, both exposed externally through a single Cloudflare Tunnel.

1732. Find the Highest Altitude

There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0. You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i and i + 1 for all (0 <= i < n). Return the highest altitude of a point.
/**
 * @param {number[]} gain
 * @return {number}
 */
var largestAltitude = function(gain) {
    // Current altitude as we move through the gain array.
    // We always start at altitude 0.
    let altitude = 0;

    // Track the highest altitude reached at any point.
    // Since we start at 0, the minimum possible highest altitude is 0.
    let highest = 0;

    // Iterate through each change in altitude.
    for (let g of gain) {
        // Apply the gain/loss to the current altitude.
       

FLIP Dual Rest Noise

Advects noise through a flip simulation using the dual rest fields that are advected through the sim when enabled in the flip solver. MUST promote rest_ratio and rest2_ratio attributes from detail to points.
float freq = chf("freq");

float n_rest = noise(v@rest  * freq);
float n_rest_2 = noise(v@rest2 * freq);

float nr = f@rest_ratio;
float nr2 = f@rest2_ratio;

float n = (n_rest * nr + n_rest_2 * nr2) / max(nr + nr2, 0.0001);

f@noise = n;

shareAPIでコピーも共有も実現する

<button class="share-button" type="button" data-open-share>共有する</button>

IELTS 5-13

Gloria
Forthy
451
bank transfer
cats
8:30
clothes
nurse
information bag
weekend
60
married couple

independatble
website
guest

one-day
control
special tools
B
A
C
A
C
well head
carb rock
sensors
by sattelite
4 weeks
cociousness
subcontious


sense organs
concerns
homework
C
E
G


disinclined
altitude