3573. Best Time to Buy and Sell Stock V

You are given an integer array prices where prices[i] is the price of a stock in dollars on the ith day, and an integer k. You are allowed to make at most k transactions, where each transaction can be either of the following: Normal transaction: Buy on day i, then sell on a later day j where i < j. You profit prices[j] - prices[i]. Short selling transaction: Sell on day i, then buy back on a later day j where i < j. You profit prices[i] - prices[j]. Note that you must complete each transaction before starting another. Additionally, you can't buy or sell on the same day you are selling or buying back as part of a previous transaction. Return the maximum total profit you can earn by making at most k transactions.
/**
 * @param {number[]} prices
 * @param {number} k
 * @return {number}
 */
var maximumProfit = function(prices, k) {
    // Edge cases
    const n = prices.length;
    if (n === 0 || k === 0) return 0;

    // We will NOT use the "unlimited transactions" shortcut because
    // the problem forbids opening a new position on the same day we close one.
    // That restriction breaks the usual greedy sum of daily deltas.

    // dp[t][i][state]
    // - t: number of COMPLETED transactions so far (

Spark Streaming - Focus - Modes de Sortie

# Focus : Modes de Sortie (Append, Update, Complete)

> **Prérequis** : Guide principal, notions de watermark  
> **Objectif** : Choisir le bon mode selon le use case  
> **Format** : Focus pratique (~250 lignes)

---

## 1. Les trois modes en une image

```
┌─────────────────────────────────────────────────────────────┐
│                    MODES DE SORTIE                          │
├─────────────────────────────────────────────────────────────┤
│                                                

Spark Streaming - Deep Dive - Architecture Medaillon

# Deep Dive : Architecture Médaillon (Bronze / Silver / Gold)

> **Prérequis** : Guide principal, Deep Dives Watermarks et Checkpointing  
> **Objectif** : Implémenter un pipeline Médaillon robuste en streaming  
> **Contexte** : Pipelines IoT avec Delta Lake

---

## Table des matières

1. [Philosophie et principes](#1-philosophie-et-principes)
2. [Couche Bronze : ingestion brute](#2-couche-bronze--ingestion-brute)
3. [Couche Silver : conformité et qualité](#3-couche-silver--conformité-et-quali

Spark Streaming - Deep Dive - Checkpoints

# Deep Dive : Checkpointing et Tolérance aux Pannes

> **Prérequis** : Lecture du guide principal (section 4), Deep Dive Watermarks  
> **Objectif** : Maîtriser la persistance d'état et la reprise sur erreur  
> **Contexte** : Pipelines IoT en production

---

## Table des matières

1. [Pourquoi le checkpoint est vital](#1-pourquoi-le-checkpoint-est-vital)
2. [Anatomie d'un checkpoint](#2-anatomie-dun-checkpoint)
3. [Configuration et stockage](#3-configuration-et-stockage)
4. [Scénarios de recov

Spark Streaming - Deep Dive - Fenêtres Temporelles et Watermarks

# Deep Dive : Fenêtres Temporelles et Watermarks

> **Prérequis** : Lecture du guide principal (sections 1, 6)  
> **Objectif** : Maîtriser la gestion du temps en streaming  
> **Approche** : Complexité croissante, du cas simple aux scénarios avancés

---

## Table des matières

1. [Pourquoi c'est difficile](#1-pourquoi-cest-difficile)
2. [Les deux temps du streaming](#2-les-deux-temps-du-streaming)
3. [Anatomie d'un Watermark](#3-anatomie-dun-watermark)
4. [Fenêtres en profondeur](#4-fenêtres-e

Spark Streaming - Vue d'Ensemble

# Spark Structured Streaming : Guide Fondamental

> **Contexte** : Formation Data Engineer  
> **Cas d'usage** : Traitement de logs IoT  
> **Prérequis** : Python solide, bases Spark SQL/DataFrame  
> **Suite du cursus** : Kafka, Delta Lake

---

## Table des matières

1. [Principe du Streaming Structuré](#1-principe-du-streaming-structuré)
2. [Lecture et Écriture de Flux](#2-lecture-et-écriture-de-flux)
3. [Modes de Sortie](#3-modes-de-sortie-append-update-complete)
4. [Checkpointing et Toléran

【リダイレクト】拡張子ファイルからディレクトリへ

RewriteEngine on
Redirect 301 /bbb.html https://aaa.jp/bb/ccc

git revert

# git revert

```
# 1. 使用 --no-commit 参数 revert 所有 commits(不立即提交)
git revert --no-commit -m 1 <commit3>  # merge commit 需要 -m 1
git revert --no-commit -m 1 <commit2>  # merge commit 需要 -m 1
git revert --no-commit <commit1>       # 普通 commit

# 2. 一次性提交所有 revert 更改
git commit -m "Revert to commit <commit> - 回滚到上个版本"
```

`-m 1` 的含义:

普通 commit 只有一个父分支,merge commit 有两个父分支。

* `-m 1`:保留第一个父分支(被合并到的分支,例如 prod)
* `-m 2`:保留第二个父分支(被合并进来的分支,例如 test)

所以几乎 git rever merge commit 时都会带上 `-m 1`

datcangio.vn

# class-wooviet-currency.php
```php
public function convert_price_thousand_to_k( $thousand_text = ' K' ) {
		$this->thousand_text = $thousand_text;
		add_filter( 'formatted_woocommerce_price', array( $this, 'filter_formatted_woocommerce_price' ), 10, 5 );
	}
public function filter_formatted_woocommerce_price( $formatted_price, $price, $decimals, $decimal_separator, $thousand_separator ) {

		if ( $price < 1000 ) {
			return $formatted_price;
		} else {
			$decimals=2;
			$suffix = $this->thousan

Fusion360

# TXT COMMANDS
##### Show Unconstrained Geo:
```
Sketch.ShowUnderconstrained
```

Joomla debugging with XDebug and Visual Studio Code

Joomla debugging with XDebug and Visual Studio Code on Windows
# Xdebug Setup for Joomla and VS Code on Windows

## Step 1: Install Xdebug

1. Copy `phpinfo()` output and paste it into [Xdebug Wizard](https://xdebug.org/wizard).
2. Download `xdebug.dll`.
3. Copy the DLL to your PHP `ext` folder.
4. Add the following configuration to your `php.ini`:

```ini
[xdebug]
zend_extension = xdebug
xdebug.mode = develop,debug
xdebug.start_with_request = yes
xdebug.client_host = 127.0.0.1
xdebug.client_port = 9003
xdebug.var_display_max_depth = 5
xdebug.var_display_ma

Elementor Register

/* Per Elementor che su Register non va neanche a spinta e in discesa,
 * in php extension:
 * disattivato: ioncube_loader
 * e attivato: opcache
 */
define('ELEMENTOR_LOAD_ICON_MANAGER_EARLY', true);
define('ELEMENTOR_EDITOR_BREAKPOINTS', true);
define('ELEMENTOR_DISABLE_ISOLATION', true);
/* E se serve
 * imposta Memory Limit
 */
define('WP_MEMORY_LIMIT', '512M');
define('WP_MAX_MEMORY_LIMIT', '512M');

Nosto Dynamic Cards

Source: https://docs.nosto.com/shopify/styling-options-dynamic-product-cards

# Styling Options - Dynamic Product Cards

## What Dynamic Product Cards are

Our `DynamicCard` Web Component offers a clean, flexible way to render Shopify product cards within Nosto-powered experiences, by fully deferring product markup to Shopify. This is especially useful for merchants who want their storefront's visual identity and product logic to remain unified, whilte still utilising Nosto's Personalization cap

3562. Maximum Profit from Trading Stocks with Discounts

You are given an integer n, representing the number of employees in a company. Each employee is assigned a unique ID from 1 to n, and employee 1 is the CEO. You are given two 1-based integer arrays, present and future, each of length n, where: present[i] represents the current price at which the ith employee can buy a stock today. future[i] represents the expected price at which the ith employee can sell the stock tomorrow. The company's hierarchy is represented by a 2D integer array hierarchy, where hierarchy[i] = [ui, vi] means that employee ui is the direct boss of employee vi. Additionally, you have an integer budget representing the total funds available for investment. However, the company has a discount policy: if an employee's direct boss purchases their own stock, then the employee can buy their stock at half the original price (floor(present[v] / 2)). Return the maximum profit that can be achieved without exceeding the given budget. Note: You may buy each stock at most once. You cannot use any profit earned from future stock prices to fund additional investments and must buy only from budget.
/**
 * @param {number} n
 * @param {number[]} present
 * @param {number[]} future
 * @param {number[][]} hierarchy
 * @param {number} budget
 * @return {number}
 */
var maxProfit = function(n, present, future, hierarchy, budget) {
  const employeeCount = n;
  const budgetLimit = budget;
  const budgetStride = budgetLimit + 1;

  // Sentinel value for unreachable DP states
  const MIN_PROFIT = -1_000_000_000;

  // Price arrays (1-indexed by employee ID for convenience)
  const presentPrice = new

ECODROP - update_so_bal_edit

salesorderID = salesorder.get("salesorder_id");
organizationID = organization.get("organization_id");
invTot = 0.0;
resp = zoho.books.getRecordsByID("Salesorders",organizationID,salesorderID).get("salesorder");
for each  invoice in resp.get("invoices")
{
	invTot = invTot + invoice.toMap().get("total");
}
balance = salesorder.get("total").toDecimal() - invTot;
updateMap = Map();
updateMap.put("custom_fields",{{"customfield_id":"337859000000099002","value":balance}});
zoho.books.updateR

ECODROP - update_so_bal_create

salesorderID = salesorder.get("salesorder_id");
organizationID = organization.get("organization_id");
updateMap = Map();
updateMap.put("custom_fields",{{"customfield_id":"337859000000099002","value":salesorder.get("total")}});
info zoho.books.updateRecord("Salesorders",organizationID,salesorderID,updateMap);