2977. Minimum Cost to Convert String II

You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English characters. You are also given two 0-indexed string arrays original and changed, and an integer array cost, where cost[i] represents the cost of converting the string original[i] to the string changed[i]. You start with the string source. In one operation, you can pick a substring x from the string, and change it to y at a cost of z if there exists any index j such that cost[j] == z, original[j] == x, and changed[j] == y. You are allowed to do any number of operations, but any pair of operations must satisfy either of these two conditions: The substrings picked in the operations are source[a..b] and source[c..d] with either b < c or d < a. In other words, the indices picked in both operations are disjoint. The substrings picked in the operations are source[a..b] and source[c..d] with a == c and b == d. In other words, the indices picked in both operations are identical. Return the minimum cost to convert the string source to the string target using any number of operations. If it is impossible to convert source to target, return -1. Note that there may exist indices i, j such that original[j] == original[i] and changed[j] == changed[i].
/**
 * @param {string} source
 * @param {string} target
 * @param {string[]} original
 * @param {string[]} changed
 * @param {number[]} cost
 * @return {number}
 */
var minimumCost = function (source, target, original, changed, cost) {
    // A very large BigInt used to represent "infinity"
    const INF = BigInt("18446744073709551615");

    // Map each unique substring to a numeric ID
    const id = new Map();

    // Track all substring lengths that appear in rules
    const lens = new Set();

How to casting values in Java?

// (targetType) value

byte myNewByteValue = (myMinByteValue / 2)

// |  Error:
// |  incompatible types: possible lossy conversion from int to byte
// |  byte myNewByteValue = (myMinByteValue / 2);
// |                         ^----------------^

byte myNewByteValue = (byte) (myMinByteValue / 2)
myNewByteValue ==> -64

EXPLAIN

EXPLAIN FORMAT=JSON
SELECT
    id,
    status,
    freeRoundFeature
FROM
    AccountFreeSpin
WHERE 1
  AND id IN (1)
--- живой
EXPLAIN ANALYZE
    SELECT
    id,
    status,
    freeRoundFeature
FROM
    AccountFreeSpin
WHERE 1
  AND id IN (1)

表示中のセクション・その前後をCSSで判定する

<nav class="toc">
<ol class="toc-list">
  <li><a href="#section1" class="link">セクション1</a></li>
  <li><a href="#section2" class="link">セクション2</a></li>
  <li><a href="#section3" class="link">セクション3</a></li>
  <li><a href="#section4" class="link">セクション4</a></li>
</ol>
</nav>

<main>
<section id="section1" class="section">
  <h2>セクション1</h2>
</section>
<section id="section2" class="section">
  <h2>セクション2</h2>
</section>
<section id="section3" class="section">
  <h2>セクション3</h2>
</section>
<section id=

DLS3 - Project cd /project/2024/202404/202404.01/001/



# Load in study data
# -- for creating the 'unlinked' files, general demog checking, and eventually extracting the index date
create table prj20240401_demog(studyid varchar, first_name varchar, middle_initials varchar, last_name varchar, dob varchar, sex varchar, address_1 varchar, suburb varchar, address_3 varchar, postcode varchar, hsn_issued_date varchar);
\copy prj20240401_demog from minehealth.txt delimiter E'\t';
delete from prj20240401_demog where studyid='HSN_NUM';
#244085

# 

Geocoding

For all WACR records in WADLS, Epi have requested a one-off extract of:
-       WACR OID (raw, no encryption needed)
-       LGA (1996, 2001, 2006, 2011, 2016, 2021)
-       SLA (1996, 2001, 2006)
-       SA2 (2011, 2016, 2021)
______________________________________________________________

Total no. of records
>> SELECT COUNT(distinct lpno) AS total_count
FROM cancdata ;
 total_count
-------------
      632419
>>\pset format unaligned
>>\pset footer off
# Copy the required conten

Weplayed

# site example: https://gocamels.com/
<script>
  require(['//media.weplayed.com/widget/v1/widget.js'], function ($) {

    // 1) Fix: aria-hidden="true" must not be focusable
    function fixAriaHiddenFocusable(root = document) {
      let changed = false;
      root.querySelectorAll('[aria-hidden="true"][tabindex]').forEach(el => {
        const ti = el.getAttribute('tabindex');
        if (ti === '0') {
          el.setAttribute('tabindex', '-1');
          changed = true;
        }
      });
      return changed;
  

DBT - DATA FLOW (exemple du template)

# Flux de données dbt — Vue complète

## Schéma global

```
┌─────────────────────────────────────────────────────────────────────────────┐
│                              FICHIERS SOURCE                                │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│   seeds/sample_data/              seeds/reference/                          │
│   ├── raw_customers.csv           ├── 

DUCKDB - CLI - CheatSheet - Quick Inspection

# DuckDB CLI — Cheatsheet inspection

## Ouvrir une base

```bash
duckdb dev.duckdb
```

## Schemas

```sql
-- Lister tous les schemas
SELECT * FROM duckdb_schemas();

-- Filtrer les schemas utilisateur (non internes)
SELECT schema_name FROM duckdb_schemas() WHERE internal = false;

-- Schema courant
SELECT current_schema();

-- Changer de schema
USE main_raw_dev;
```

## Tables

```sql
-- Lister toutes les tables (tous schemas)
SHOW ALL TABLES;

-- Lister les tables du schema courant
SHOW TABLE

サイトAからサイトBに着地した人数をサイトAに送信する

# クロスサイトコンバージョン計測(img ピクセル方式)

サイトA(送客元)からサイトB(送客先)への遷移を計測する汎用的な手法。
CMS や特定のサービスに依存しない、ピュア HTML + JavaScript で実現できるアプローチ。

---

## 前提

- サイトA とサイトB は異なるドメインで運用されている
- サイトB には複数の流入経路があり、サイトA 経由のユーザーのみを識別・計測したい
- サイトA 側に計測データを受け取る API エンドポイントが存在する

---

## 手順概要

### 1. サイトA → サイトB へのパラメータ付き遷移

サイトA からサイトB への遷移リンクに、一意の識別子をパラメータとして付与する。

```
https://siteb.hoge?id=fuga123
```

この識別子(以下 `click_id`)により、サイトB 側で「サイトA 経由の流入である」と判定できる。

### 2. サイトB 側で URL パラメータを Cookie に保存

サイトB の LP(ランディングページ)で、URL パラメータか

DBT - dbt seed

# dbt seed — Guide pédagogique

## Ce que `dbt seed` fait

1. **Parse** les fichiers YAML pour connaître la configuration (schema, types, colonnes)
2. **Pour chaque fichier CSV** dans `seeds/` :
   - Supprime la table si elle existe (DROP)
   - Crée la table avec les types définis (CREATE)
   - Insère les données du CSV (INSERT)

## Ce que `dbt seed` ne fait PAS

| Action | Commande |
|--------|----------|
| Exécuter les models | `dbt run` |
| Exécuter les tests | `dbt test` |
| Compiler le SQL 

DBT - Cascade de Configuration

# Cascade de configuration dbt

## Principe

dbt applique les configurations par héritage : le niveau le plus spécifique gagne toujours.

## Niveaux de priorité

```
┌─────────────────────────────────────────────────────────────┐
│  1. config() dans le fichier SQL        ← Plus spécifique   │
├─────────────────────────────────────────────────────────────┤
│  2. Fichier YAML (_seeds.yml, _models.yml)                  │
├─────────────────────────────────────────────────────────────┤
│  3. dbt_proj

DBT - Guidelines de Documentation

# Guidelines de documentation dbt

## Structure standard d'une description

```yaml
description: |
  # Titre du model/seed
  
  Description courte en une phrase.
  
  ## Grain
  Une ligne par [entité].
  
  ## Sources
  - source_1
  - source_2
  
  ## Notes
  Informations importantes, cas particuliers, hypothèses.
```

## Métadonnées recommandées

```yaml
meta:
  owner: data-team@company.com     # Responsable du model
  tier: gold                       # Niveau de qualité (bronze/silver/gold)
``

DBT - SEEDS - YAML

# Structure type : _seeds.yml

> 📖 Pour les conventions de documentation (descriptions, métadonnées, checklist), voir **dbt-documentation-guidelines.md**

## Syntaxe complète

```yaml
version: 2

seeds:
  - name: nom_du_seed               # Doit correspondre au nom du fichier CSV (sans .csv)
    description: "Description"      # Documentation (supporte le Markdown; pour du multiligne, utiliser le pipe: | ou la syntaxe YAML avancée (voir fichier doc guidelines))
    
    meta:                    

DBT - CLI CHEATSHEET

# dbt CLI Cheatsheet

## Configuration & Debug

| Commande | Effet |
|----------|-------|
| `dbt debug` | Valide la connexion et la configuration |
| `dbt deps` | Installe les packages du `packages.yml` |
| `dbt clean` | Supprime `target/`, `dbt_packages/`, `logs/` |

## Exécution

| Commande | Effet |
|----------|-------|
| `dbt seed` | Charge les fichiers CSV dans le warehouse |
| `dbt run` | Exécute tous les modèles |
| `dbt test` | Exécute tous les tests |
| `dbt build` | Fait `seed` + `run`

3651. Minimum Cost Path with Teleportations

You are given a m x n 2D integer array grid and an integer k. You start at the top-left cell (0, 0) and your goal is to reach the bottom‐right cell (m - 1, n - 1). There are two types of moves available: Normal move: You can move right or down from your current cell (i, j), i.e. you can move to (i, j + 1) (right) or (i + 1, j) (down). The cost is the value of the destination cell. Teleportation: You can teleport from any cell (i, j), to any cell (x, y) such that grid[x][y] <= grid[i][j]; the cost of this move is 0. You may teleport at most k times. Return the minimum total cost to reach cell (m - 1, n - 1) from (0, 0).
/**
 * @param {number[][]} grid
 * @param {number} k
 * @return {number}
 *
 * This solution uses a DP-by-value technique:
 * - Normal moves (right/down) cost grid[i][j]
 * - Teleports cost 0 but can only go to cells with value <= current cell
 * - We simulate using t = 0..k teleports
 *
 * Key idea:
 *   For each teleport count t, we:
 *     1. Start from the previous DP layer (t-1 teleports)
 *     2. Apply a "value sweep" that propagates the best reachable cost
 *        to all cells with <=