3202. Find the Maximum Length of Valid Subsequence II

You are given an integer array nums and a positive integer k. A subsequence sub of nums with length x is called valid if it satisfies: (sub[0] + sub[1]) % k == (sub[1] + sub[2]) % k == ... == (sub[x - 2] + sub[x - 1]) % k. Return the length of the longest valid subsequence of nums.
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var maximumLength = function(nums, k) {
    const n = nums.length;
    // dp[i][mod] = max length of valid subsequence ending at index i with mod class `mod`
    const dp = Array.from({ length: n }, () => new Map());
    let maxLength = 0;

    for (let i = 0; i < n; i++) {
        for (let j = 0; j < i; j++) {
            const modClass = (nums[i] + nums[j]) % k;

            // Get previous best length at index j for th

Bigcommerce Stencil Theme

### Downloading Copy of Parts Website for local viewing:
1) bigcommerce backend > `storefront` > `themes` > `advanced` > `download current theme`
2) `npm install`
3) ` npm install -g @bigcommerce/stencil-cli`
3) obtain a stencil cli token

```
This is the only copy you will have access to. If you lose it,
delete the account and create a new one...

xxxne8byo8nvldo7udvvaeclhbadve52nm

stencil init --url https://xxx.com --token xxxne8byo8nvldo7udvvaeclhbadve52nm 
or 
stencil init (to manually ente

PEOPLE admin : ACF render > update title on save

add_action( 'save_post', 'update_people_details', 10, 3);
function update_people_details( $post_id, $post, $update ) {
	// bail out if this is an autosave
	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
		return;
	}

	// Perform permission checks! For example:
	if ( !current_user_can('edit_post', $post_id) ) {
		return;
	}

	// Only set for post_type
	if ( $post->post_type !== 'people' ) {
		return;
	}

	// Only continue if the post being saved is NOT a draft
	if ( $pos

ADMIN > force email 2FA for all users

add_filter(
    'two_factor_enabled_providers_for_user',
    function( $providers ) {
        if ( empty( $providers ) && class_exists( 'Two_Factor_Email' ) ) {
            $providers[] = 'Two_Factor_Email';
        }

        return $providers;
    }
);

☁️ HTTP Request Flox Through AWS Lambda & FastAPI

# HTTP Request Flow Through AWS Lambda & FastAPI

## 🌐 Step 1: Original HTTP Request (from client/browser)

```http
POST https://api.example.com/chat HTTP/1.1
Host: api.example.com
Content-Type: application/json
X-Request-ID: correlation-456
Authorization: Bearer my-token-123

{
  "question": "What is the weather today?"
}
```

## 🔄 Step 2: API Gateway Transforms to Lambda Event

API Gateway receives the HTTP request and creates a Lambda event object:

```python
# This is wh

☁️ Mangum - FastAPI - API Gateway explained

I'd be happy to explain these tests in detail! These tests are checking how FastAPI integrates with AWS Lambda through API Gateway, which involves understanding several key concepts.

## The Big Picture

When you deploy FastAPI to AWS Lambda, requests follow this flow:
1. **API Gateway** receives HTTP requests from clients
2. **API Gateway** transforms the HTTP request into a Lambda **event** object
3. **Lambda** invokes your handler function with this event
4. **Mangum** (a library) tra

Unstacking a multiband raster

import rasterio
import os
import numpy as np

# Input raster path
input_raster = r"G:\1.Kanji_Projects\malawi_tci\2024\tci_malawi_2024.tif"

# Output directory
output_dir = r"G:\1.Kanji_Projects\malawi_tci\2024\unstacked"
os.makedirs(output_dir, exist_ok=True)

# Open the multiband raster
with rasterio.open(input_raster) as src:
    for i in range(1, src.count + 1):  # Bands are 1-indexed
        band = src.read(i)
        
        # Create metadata for single-band file
        

Liquid - parse URL

{%- capture contentForQuerystring -%}{{- content_for_header -}}{%- endcapture -%}
{% comment %}Use string splitting to pull the value from content_for_header and apply some string clean up{% endcomment %}
{%- liquid
  assign pageUrl = contentForQuerystring | split: '"pageurl":"' | last | split: '"' | first | split: '.com' | last | replace: '\/', '/' | replace: '%20', ' ' | replace: '\u0026', '&' | strip
  assign pageQuerystring = pageUrl | split: '?' | last
  assign partsOfQuery = pageQuery

Тестирование

custas = предпрод

Cambiare versione di node

Node 22 potrebbe essere non supportato appieno da angular CLI
✅ 1. Verifica versioni i node installato
nvm ls
Vedrai qualcosa tipo:

->     v20.12.2
       v22.14.0
default -> 20 (-> v20.12.2)
✅ 2. Passa a Node 22
nvm use 22

Scarica nuova versione di node
nvm install 20

🦑 Forgot to create feature branch?

# WHAT TO DO TO FIX THIS?
👇 **The plot**:
> You forgot to create a feature branch or to switch on it, and you've committed work on main, which is, if you followed best practises, protected from pushes and requires pull requests.
> 
> **You want then to fix this and clean up this mess**.


Here is a step-by-step guide to move your commits to a new branch and clean up your `main` branch.

### **Step 1: Create Your New Branch**

First, let's create the new feature branch. Since you're cu

Comandi Docker

🛠 Comandi da usare:

🔨 Costruisci il .jar:
./gradlew build
🧱 Costruisci l’immagine Docker:
docker build -t java-backend .
🚀 Avvia il container con nome personalizzato:
docker run --name my-backend -p 8080:8080 java-backend

🚀 Avviare il container
👉 Se non è mai stato creato:
docker run --name my-backend -p 8080:8080 java-backend
Questo crea e avvia il container per la prima volta.

👉 Se esiste già ma è fermo:
docker start my-backend

⏹️ Fermare il container
docker stop my-backend

🔁 Riavviare il

Dictionaries

// dictionaries are used to store key value pairs
// - dictionaries are dynamic in size
// - we can get values from a dictionary
// - we can set values in a dictionary
// - we can add values to a dictionary
// - we can remove values from a dictionary
// - we can clear a dictionary
// - we can check if a dictionary contains a key
// some other properties:
// - the keys in a dictionary are unique
// - the values in a dictionary do not need to be unique
// - dictionary keys do not need t

Send user email notification when created

<?php
//
$user_id = 123;

// Only to user
wp_new_user_notification( $user_id, null, 'user' );

// Only to admin
// wp_new_user_notification( $user_id, null, 'admin' );

// Both (admin + user) :
// wp_new_user_notification( $user_id, null, '' );

Lists

// lists are used to store multiple values 
// - lists are zero based
// - lists are dynamic in size
// - we can get values from a list
// - we can set values in a list
// - we can add values to a list
// - we can remove values from a list
// - we can insert values into a list
// - we can clear a list
// - we can sort a list!

// here is how we declare a list
List<string> words = new List<string>();

// here is how we add values to a list
words.Add("one");
words.Add("two");
word

Arrays

// use type in front of an array
int[] numbers = new int[] {
  5, 6, 7, 8
}

double[] numbers = {
  10.1, 10.2.10.3
}

int[] numbers = [ 1, 2, 3, 4 ]

// mixed types of array
// Array of objects can hold any type
object[] mixedArray = { 42, "Hello", 3.14, true, 'A' };

// Array of dynamic types (no compile-time type checking)
dynamic[] dynamicArray = { 100, "World", 2.71, false };

// Array of tuples with mixed types
(int id, string name, double salary)[] employees = 
{
    (1, "John", 50000.0),