2110. Number of Smooth Descent Periods of a Stock

You are given an integer array prices representing the daily price history of a stock, where prices[i] is the stock price on the ith day. A smooth descent period of a stock consists of one or more contiguous days such that the price on each day is lower than the price on the preceding day by exactly 1. The first day of the period is exempted from this rule. Return the number of smooth descent periods.
/**
 * @param {number[]} prices
 * @return {number}
 */
var getDescentPeriods = function(prices) {
    let total = 0;        // total number of descent periods
    let streak = 0;       // length of current descent streak

    for (let i = 0; i < prices.length; i++) {
        if (i > 0 && prices[i] === prices[i - 1] - 1) {
            // continue the descent streak
            streak += 1;
        } else {
            // reset streak (single day always counts)
            streak = 1;
        }
 

3D dice rolling and result

3D dice rolling and result
3D dice rolling and result
--------------------------
a 3d rolling dice and return the result in the console

A [Pen](https://codepen.io/maxew33/pen/bGaWYEw) by [maxew](https://codepen.io/maxew33) on [CodePen](https://codepen.io).

[License](https://codepen.io/license/pen/bGaWYEw).

thread vs coroutine

# 线程和协程的区别

![](https://cdn.cacher.io/attachments/u/3b81ky5kgx9lt/K326tvjq9sT3yjrqqeJEwPxQaivcFLxP/sreyf2tcl.png)

**Python 线程:抢占式调度**

1. 操作系统调度: 操作系统负责在物理 CPU 核心上调度线程的执行。
2. GIL 计时器 (Ticks): 为了保证公平,Python 解释器(受 GIL 保护)有一个内部的计时器(通常是每隔 100 毫秒或 1000 个字节码指令)。
3. 强制释放: 当一个线程持有了 GIL 并且执行时间达到这个阈值后,即使它正在执行一个方法的中间,Python 解释器也会强制让它释放 GIL,让其他等待的线程有机会获取 GIL 并运行。
4. 后果: 这就是为什么在线程环境下,共享数据的读写操作必须使用锁,因为任何一个操作都可能在任何字节码指令之后被中断,导致数据不一致。

**Python 协程:协作式调度**
协程工作在单个线程内的事件循环上。

1. 主动让出: 协程的执行是完全受控于程序自身的。协程只有在代码中明确

webフォントの上下の余白を調整する

@font-face {
  font-family: "LINE Seed JP";
  src: url("../../fonts/LINESeedJP_OTF_Rg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  ascent-override: 80%; /*ここを調整 */
  descent-override: 0%; /*ここを調整 */
}

レスポンシブ対応する最小の画面サイズを定義する

body{
  /* 最小画面幅のサポートを360pxにし、それ以下は縮小させる*/
  @media (max-width: 360px) {
    zoom: progress(100lvw, 0px, 360px);
    -webkit-text-size-adjust: initial; /* iOS Safariのバグを回避 */
  }
}

Vincit qui se vincit

Vincit qui se vincit -- He conquers who conquers himself

Freemason Values

Masonic Values

[...]  extend charity and sympathy to all mankind, shield and support the widow and orphan, defend virtue, respect the aged, honor the bonds of friendship, protect the helpless, lift up the oppressed, comfort the downcast, restore dignity to the rejected, respect the laws of government, promote morality, and add to the common stock of knowledge and understanding.

2147. Number of Ways to Divide a Long Corridor

Along a long library corridor, there is a line of seats and decorative plants. You are given a 0-indexed string corridor of length n consisting of letters 'S' and 'P' where each 'S' represents a seat and each 'P' represents a plant. One room divider has already been installed to the left of index 0, and another to the right of index n - 1. Additional room dividers can be installed. For each position between indices i - 1 and i (1 <= i <= n - 1), at most one divider can be installed. Divide the corridor into non-overlapping sections, where each section has exactly two seats with any number of plants. There may be multiple ways to perform the division. Two ways are different if there is a position with a room divider installed in the first way but not in the second way. Return the number of ways to divide the corridor. Since the answer may be very large, return it modulo 109 + 7. If there is no way, return 0.
/**
 * Calculates the number of ways to divide a corridor into valid sections.
 * Each section must contain exactly two 'S' (seats).
 * 'P' (plants) between pairs of seats determine possible partitions.
 *
 * @param {string} corridor - A string consisting of 'S' (seats) and 'P' (plants).
 * @return {number} - The number of valid ways to divide the corridor.
 */
var numberOfWays = function(corridor) {
    const MOD = 1e9 + 7;  // Large prime modulus to prevent overflow
    let product = 1;      /

C1 U11

E
extremely
totally
absolutely
absolutely
completely
quite
a bit
totally

F
absolutely gourgeous
absolutely ancient
absolutely packed
absolutely filthy
absolutely exhausted
absolutely boiling/scorching
absolutely hideous
absolutely starving

G
markedly
strengthened
percentage
occasionally
arrangement
guardianship
Vocab: heirs, consented, reared, markedly

H
overlookod
set of feeling

school

callous and rebellous
stronger relationships
sense of self

I
drag
come to light
at this stage
bowed well

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