km-berechnung v2

import os
import sys
import json
import random
import getpass
import re
from datetime import datetime

try:
    import openai
    import googlemaps
    from tqdm import tqdm
except ImportError:
    import subprocess
    subprocess.check_call([sys.executable, "-m", "pip", "install", "openai", "googlemaps", "tqdm"])
    import openai
    import googlemaps
    from tqdm import tqdm

# === Einstellungen ===
user = getpass.getuser().lower()
base_path = f"C:/Users/{user}/OneDrive/

3606. Coupon Code Validator

You are given three arrays of length n that describe the properties of n coupons: code, businessLine, and isActive. The ith coupon has: code[i]: a string representing the coupon identifier. businessLine[i]: a string denoting the business category of the coupon. isActive[i]: a boolean indicating whether the coupon is currently active. A coupon is considered valid if all of the following conditions hold: code[i] is non-empty and consists only of alphanumeric characters (a-z, A-Z, 0-9) and underscores (_). businessLine[i] is one of the following four categories: "electronics", "grocery", "pharmacy", "restaurant". isActive[i] is true. Return an array of the codes of all valid coupons, sorted first by their businessLine in the order: "electronics", "grocery", "pharmacy", "restaurant", and then by code in lexicographical (ascending) order within each category.
/**
 * @param {string[]} code
 * @param {string[]} businessLine
 * @param {boolean[]} isActive
 * @return {string[]}
 */
var validateCoupons = function(code, businessLine, isActive) {
    // Guard: ensure arrays exist and have equal length
    if (!Array.isArray(code) || !Array.isArray(businessLine) || !Array.isArray(isActive)) return [];
    const n = Math.min(code.length, businessLine.length, isActive.length);
    if (n === 0) return [];

    // Fixed category order and a lookup for O(1) index

Telegram:@JeansonTooL Bank To Bank Drop Wire Logs PayPal Zelle Venmo Apple Pay Skrill WU Transfer Bug MoneyGram Transfer



Scattered Spider (and allied group Scattered LAPSUS$ Hunters) 🌎 


VERIFIED CARDER SELLING WU,BANK,PAYPAL,CASHAPP,SKRILL TRANSFER BANK LOGS,DUMPS+PIN,CLONED CARDS

Telegram: JeansonTooL SELL CCV CANADA FULLZ FRESH SSN DOB WITH DL LIVE MAIL PASSWORD OFFICE365 PAYPAL

Telegram: JeansonTooL CVV,Fullz,Dumps,PayPal Debit/Credit Card,CashApp, Western Union, Transfer,ATM Clone Cards!!

Telegram: JeansonTooL SELL CVV FULLZ INFO GOOD USA-UK-CA-AU-INTER,PASS VBV/BIN/DOB

Telegram: JeansonTooL : Sell Dum

3433. Count Mentions Per User

You are given an integer numberOfUsers representing the total number of users and an array events of size n x 3. Each events[i] can be either of the following two types: Message Event: ["MESSAGE", "timestampi", "mentions_stringi"] This event indicates that a set of users was mentioned in a message at timestampi. The mentions_stringi string can contain one of the following tokens: id<number>: where <number> is an integer in range [0,numberOfUsers - 1]. There can be multiple ids separated by a single whitespace and may contain duplicates. This can mention even the offline users. ALL: mentions all users. HERE: mentions all online users. Offline Event: ["OFFLINE", "timestampi", "idi"] This event indicates that the user idi had become offline at timestampi for 60 time units. The user will automatically be online again at time timestampi + 60. Return an array mentions where mentions[i] represents the number of mentions the user with id i has across all MESSAGE events. All users are initially online, and if a user goes offline or comes back online, their status change is processed before handling any message event that occurs at the same timestamp. Note that a user can be mentioned multiple times in a single message event, and each mention should be counted separately.
/**
 * @param {number} numberOfUsers
 * @param {string[][]} events
 * @return {number[]}
 */
var countMentions = function(numberOfUsers, events) {
    // Result: mentions per user
    const mentions = new Array(numberOfUsers).fill(0);

    // Online state and offline-until times
    const online = new Array(numberOfUsers).fill(true);
    const offlineUntil = new Array(numberOfUsers).fill(-1);

    // Normalize and sort:
    // - ensure timestamps are numbers
    // - sort by timestamp ascending

Caching Rails

### Caching using Redis (Summit)
#### Model Caching
```ruby
# controller
prod.get_cached_images

# product model
private

def get_cached_images
  Rails.cache.fetch(['Product', 'images', id]) do
    images.to_a
  end
end
```

- `Rails.cache.fetch` is used to initiate the cache key and look for it in the
databse
- To expire the cache, when the model updates:
```ruby
# use a callback in the model
after_commit :flush_cache

private
def flush_cache
  ExpireModelCacheJob...
  # using rake task to expi

remove bullets from html list <ul><li>

.list {
  list-style-type: none;
}

.list li::marker {
  content: "";
}

termine generieren v3

# ------------------------------------------------------------
# Automatischer Paketimport & -Installation
# ------------------------------------------------------------
import sys
import subprocess
import importlib
import importlib.util

def ensure_package(pkg_name, import_name=None):
    """
    Stellt sicher, dass ein Paket installiert und importierbar ist.
    Falls nicht installiert, wird es automatisch via pip installiert.
    """
    name_to_check = import_name or pkg_name
 

HTML PopUp zonder EngageBox

voor kerst-popups ect... gewoon als HTML blok in YooTheme, of SP-Page Builder plaatsen. ![](https://cdn.cacher.io/attachments/u/3n0fz6yyl8eu5/wTLDa9FoQ_xBEZfYVCnLCIMx6fNm6lKj/Screenshot_2025-12-12_at_07-33-36_Website_Builder_-_StruunTX.png)
<div>
  <style>
    dialog::backdrop {
      background: rgba(0, 0, 0, 0.6);
    }
    dialog {
      border: none;
      border-radius: 8px;
      padding: 20px 30px;
      max-width: 600px;
      width: 90%;
      text-align: center;
      color: #000;
      animation: fadeIn 0.2s ease-out;
        background-color: #bc4749;
    }
     
      
      dialog h3{
             color: white !important; 
          text-shadow: none !important;
      }
          
      
    dialog p {
      color: wh

multi_thread

# multi thread

Python 解释器会在以下情况释放 GIL:
1. **字节码计数器达到阈值**(默认每 100 条字节码)
2. I/O 操作(文件、网络、sleep 等)
3. 某些内置函数调用
4. 显式的 GIL 释放(如 C 扩展)

线程切换并不以方法为边界,方法中间也可能被切换。所以 GIL 并不能保证线程安全,需要以操作是否是原子来判断是否安全。

```python 
# 原子操作:
x = 123                    # 简单赋值
x = y                      # 变量赋值
L.append(x)                # list.append
L1.extend(L2)             # list.extend
x = L.pop()               # list.pop
d[key] = value            # dict 赋值

# 非原子操作:
x += 1                     # 需要锁
x = x + 1              

3531. Count Covered Buildings

You are given a positive integer n, representing an n x n city. You are also given a 2D grid buildings, where buildings[i] = [x, y] denotes a unique building located at coordinates [x, y]. A building is covered if there is at least one building in all four directions: left, right, above, and below. Return the number of covered buildings.
/**
 * @param {number} n
 * @param {number[][]} buildings
 * @return {number}
 */
var countCoveredBuildings = function(n, buildings) {
    // Guard: empty list -> no covered buildings
    if (!buildings || buildings.length === 0) return 0;

    // Step 1: Precompute extremes per row (y) and column (x).
    // minX[y], maxX[y]: smallest and largest x in row y
    // minY[x], maxY[x]: smallest and largest y in column x
    const minX = new Map();
    const maxX = new Map();
    const minY = new Ma

Disable admin account crration in WP

Saved from https://deyaph.gr/wp-admin/admin.php?page=edit-snippet&id=8
add_action('user_register', function($user_id) {
    $user = get_userdata($user_id);
    if (in_array('administrator', $user->roles, true)) {
        require_once ABSPATH . 'wp-admin/includes/user.php';
        wp_delete_user($user_id);
        wp_die('Admin account creation is disabled.');
    }
});

3577. Count the Number of Computer Unlocking Permutations

You are given an array complexity of length n. There are n locked computers in a room with labels from 0 to n - 1, each with its own unique password. The password of the computer i has a complexity complexity[i]. The password for the computer labeled 0 is already decrypted and serves as the root. All other computers must be unlocked using it or another previously unlocked computer, following this information: You can decrypt the password for the computer i using the password for computer j, where j is any integer less than i with a lower complexity. (i.e. j < i and complexity[j] < complexity[i]) To decrypt the password for computer i, you must have already unlocked a computer j such that j < i and complexity[j] < complexity[i]. Find the number of permutations of [0, 1, 2, ..., (n - 1)] that represent a valid order in which the computers can be unlocked, starting from computer 0 as the only initially unlocked one. Since the answer may be large, return it modulo 109 + 7. Note that the password for the computer with label 0 is decrypted, and not the computer with the first position in the permutation.
/**
 * @param {number[]} complexity
 * @return {number}
 */
var countPermutations = function(complexity) {
    const n = complexity.length;
    const MOD = 1_000_000_007; // Large prime modulus for preventing overflow

    // Check validity: all elements after the first must be strictly greater
    for (let i = 1; i < n; i++) {
        if (complexity[i] <= complexity[0]) {
            return 0; // Invalid case
        }
    }

    // Compute factorial of (n-1) modulo MOD
    let result = 1;
    

OpenWRT in VirtualBox

- Download a stable release of the openwrt-x86-64-combined-ext4.img.gz image from targets/x86/64/ folder e.g. [https://archive.openwrt.org/releases/24.10.4/targets/x86/64/openwrt-24.10.4-x86-64-generic-ext4-combined.img.gz]()
- Uncompress the gziped img file. On Linux use the command `gzip -d openwrt-*.img.gz`. As a result you should get the raw `openwrt-x86-64-combined-ext4.img` image file.
- Convert it to native VBox format: `VBoxManage convertfromraw --format VDI openwrt-*.img openwrt.vdi`. T

ai docs

### Create TanStack Start Project with shadcn/ui

Source: https://ui.shadcn.com/docs/installation/tanstack

Initialize a new TanStack Start project with Tailwind CSS and shadcn/ui add-ons pre-configured. This command sets up the project structure and installs necessary dependencies in one command.

```bash
npm create @tanstack/start@latest --tailwind --add-ons shadcn
```

--------------------------------

### Install All shadcn/ui Components

Source: https://ui.shadcn.com/docs/installation/tanst

menu-layout.html

<!DOCTYPE html>
<html lang="ja">
<head>
  <meta charset="UTF-8" />
  <title>Nutrition Menu Demo</title>
  <style>
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      padding: 40px 16px;
      background: #fff7fb;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    }

    .nutrition-card {
      wi

LSTM Model Prediction

def generate_forecast_features(start_date: str, end_date: str) -> pd.DataFrame:
    """
    Generate a feature-engineered datetime DataFrame for model prediction.
    
    Parameters
    ----------
    start_date : str  
        Start date in 'YYYY-MM-DD' format.
    end_date : str  
        End date in 'YYYY-MM-DD' format.

    Returns
    -------
    pd.DataFrame  
        DataFrame indexed by datetime with all required time & cyclic features.
    """

    # Convert input date