2048. Next Greater Numerically Balanced Number

An integer x is numerically balanced if for every digit d in the number x, there are exactly d occurrences of that digit in x. Given an integer n, return the smallest numerically balanced number strictly greater than n.
/**
 * Finds the next "beautiful" number greater than the given input.
 * A beautiful number is defined as one where each digit appears exactly as many times as its value.
 * For example, 22 is beautiful because digit 2 appears twice.
 *
 * @param {number} n - The input number.
 * @return {number} - The next beautiful number greater than n.
 */
var nextBeautifulNumber = function(n) {
    // Precomputed list of beautiful numbers in ascending order.
    // These are numbers where each digit appear

Specification pattern

<?php

// ============================================================================
// FOTBALISTA - Entita
// ============================================================================

class Player 
{
    private string $name;
    private int $age;
    private string $position; // 'goalkeeper', 'defender', 'midfielder', 'forward'
    private int $goals;
    private int $yellowCards;
    private int $redCards;
    private bool $isInjured;
    private int $matchesPlayed;
    
    public func

PHP OOP Tricks & Tips - part 2

```php
<?php
/**
 * ========================================
 * 📦 Další praktické OOP koncepty (krátce)
 * ========================================
 */

// ============================================================================
// 1. 📦 DTO (Data Transfer Objects) - Typované přenosy dat
// ============================================================================

// ❌ ŠPATNĚ - Arrays všude
function createOrder(array $data) 
{
    $customerId = $data['customer_id']; // Může chybět!
    $it

Immutable pattern

```php
<?php
/**
 * ========================================
 * 🔒 IMMUTABLE OBJECTS - Kompletní průvodce
 * ========================================
 */

// ============================================================================
// CO TO JE?
// ============================================================================

/*
IMMUTABLE OBJEKT = objekt, který po vytvoření NELZE ZMĚNIT
Místo změny vracíš NOVÝ objekt

DŮVOD: Bezpečnost, předvídatelnost, žádné vedlejší efekty
*/


// ============

PHP OOP Tricks & Tips

```php
<?php
/**
 * ========================================
 * PHP/OOP Best Practices & Patterns
 * ========================================
 */

// ============================================================================
// 1. ✅ KONSTANTY MÍSTO "MAGIC STRINGS"
// ============================================================================

// ❌ ŠPATNĚ - Magic strings, překlepy nenajdeš
if ($order->state === 'pending') { }
if ($order->state === 'pendig') { } // Překlep!

// ✅ DOBŘE - Konsta

WA Braze implementation

# Tài liệu Triển khai Braze - WAmazing App

## Mục lục

1. [Tổng quan](#tổng-quan)
2. [Cấu hình môi trường](#cấu-hình-môi-trường)
3. [Triển khai Android](#triển-khai-android)
4. [Triển khai iOS](#triển-khai-ios)
5. [Event Tracking](#event-tracking)
6. [SDK Debugger](#sdk-debugger)
7. [Content Cards](#content-cards)
8. [Monitoring và Analytics](#monitoring-và-analytics)

## Tổng quan

Braze được sử dụng trong WAmazing app để:

- **Event Tracking**: Theo dõi hành vi người dùng
- **Content Cards**:

TW: Responsive css var

<!--
  https://play.tailwindcss.com/V4B6tDWkg1
-->



<div class="[--color:red] md:[--color:green]">
  <div class="aspect-square w-20 bg-[var(--color)]">1</div>
  <div class="aspect-square w-20 bg-[--color]">2</div>
</div>

Practice File for Jupyter Notebook

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4a9d1041",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello, Joseph Baker!\n",
      "Welcome, Joseph Baker! This is message number 1.\n",
      "Welcome, Joseph Baker! This is message number 2.\n",
      "Welcome, Joseph Baker! This is message number 3.\n"
     ]
    }
   ],
   "source": [
    "def user_name():\n",
    "    user_name = input(\"Ent

Setup-and-Start-Cacher-Server

These commands are for setting up and starting a Cacher CLI Server to be abe to run commands from Cacher to my local machine.
# 1. confirm node & npm
node -v
npm -v

# 2. create folder and server file
mkdir $env:USERPROFILE\Projects\NodeProjects\node-test
cd $env:USERPROFILE\Projects\NodeProjects\node-test
notepad server.mjs   # paste your ESM server code and save

# 3. run server
node server.mjs
# then visit http://127.0.0.1:3000 in your browser

# 4. Then (in a new PowerShell window) install the Cacher CLI:
npm install -g @cacherapp/cli
cacher run-server:start -o file://

# Copy the Address & Token o

Hydro- Create coupes on Flow

# Task
Creation des coupes 20m amont et 20m aval si le profil contiens ausii bis et ter (exemple "Profil_04")
![](https://cdn.cacher.io/attachments/u/3fx93fy4dqwj6/YU9PhEdsUl8co_w7654lHbrV7eRpIc-s/bcryfxtp5.png)

# Etape 1
Executer script in consol python qui creera values avec bis et ter pour toutes les attributes de colonne "Profils" 20m among et aval:
```python
from qgis.core import *
import math

# ---- paramètres à adapter ----
NOM_AXE = 'Flow'                    # couche de l'écoulement
NO

Value object - Cards example

<?php

// c
$pickedCard = new Card(new CardSuit(CardSuit::SPADES), new CardRank(CardRank::ACE));

// d
$aceSpade = new Card(CardSuit::spades(), CardRank::ace());
$twoSpade = new Card(CardSuit::spades(), CardRank::two());
if ($aceSpace->isGreaterThan($twoSpade)) {
    // do something when greater, such as sum the weight to count points
}

3461. Check If Digits Are Equal in String After Operations I

You are given a string s consisting of digits. Perform the following operation repeatedly until the string has exactly two digits: For each pair of consecutive digits in s, starting from the first digit, calculate a new digit as the sum of the two digits modulo 10. Replace s with the sequence of newly calculated digits, maintaining the order in which they are computed. Return true if the final two digits in s are the same; otherwise, return false.
/**
 * @param {string} s
 * @return {boolean}
 */
var hasSameDigits = function(s) {
    // Convert the input string into an array of digits (as numbers)
    let digits = s.split('').map(Number);

    // Repeat the transformation until only two digits remain
    while (digits.length > 2) {
        let nextDigits = [];

        // Loop through each pair of consecutive digits
        for (let i = 0; i < digits.length - 1; i++) {
            // Compute the sum modulo 10
            let sumMod10 = (d

Make dropdown Menu items accessible in YooTheme

<script>
document.addEventListener('DOMContentLoaded', function () {

  // 1) Selecteer alle navigaties waar dropdowns kunnen staan
  const navRoots = document.querySelectorAll('.uk-navbar-nav, .uk-nav');

  // 2) Voeg ARIA aan ouderlinks toe en verberg het icoon voor SR
  navRoots.forEach(nav => {
    nav.querySelectorAll('li.uk-parent > a, li.menu-item-has-children > a').forEach(link => {

      // aria-attributen op de toggle
      link.setAttribute('aria-haspopup', 'true');
      if (!link.h

HTTP Requests Learning

## I am Learning HTTP requests. So I will record my learning journey here. 🚀

// ========================================
// lib/api.ts
// ========================================

// Your best-of-both-worlds Axios instance is ready (JWT + logging + 401 handling).

// Attach token automatically

// Redirect to /login on 401

// Simplified response (response.data)

import axios from 'axios';
import Router from 'next/router';

const api = axios.create({
  baseURL: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:5000',
  headers: { 'Content-Type': 'application/json' },

3347. Maximum Frequency of an Element After Performing Operations II

You are given an integer array nums and two integers k and numOperations. You must perform an operation numOperations times on nums, where in each operation you: Select an index i that was not selected in any previous operations. Add an integer in the range [-k, k] to nums[i]. Return the maximum possible frequency of any element in nums after performing the operations.
/**
 * @param {number[]} nums
 * @param {number} k
 * @param {number} numOperations
 * @return {number}
 */
var maxFrequency = function (nums, k, numOperations) {
    // Sort the array to enable binary search and range grouping
    nums.sort((a, b) => a - b);

    let maxFreq = 0;
    const numCount = new Map(); // Stores frequency of each unique number
    const candidateModes = new Set(); // Stores potential target values to maximize frequency

    // Helper to add a value and its ±k neighbors

Sonar Tips and Tricks

# Sonar Tips and Tricks

### Specify project name

Add to the parent pom in the properties part:

```
  <properties>
    <sonar.projectKey>NAME-IN-SONAR-QUBE</sonar.projectKey>
  </properties>
```