3286. Find a Safe Walk Through a Grid

You are given an m x n binary matrix grid and an integer health. You start on the upper-left corner (0, 0) and would like to get to the lower-right corner (m - 1, n - 1). You can move up, down, left, or right from one cell to another adjacent cell as long as your health remains positive. Cells (i, j) with grid[i][j] = 1 are considered unsafe and reduce your health by 1. Return true if you can reach the final cell with a health value of 1 or more, and false otherwise.
/**
 * @param {number[][]} grid
 * @param {number} health
 * @return {boolean}
 */
var findSafeWalk = function (grid, health) {
  const m = grid.length;
  const n = grid[0].length;

  // dist[i][j] = minimum health lost to reach cell (i, j)
  const dist = Array.from({ length: m }, () => Array(n).fill(Infinity));

  // Starting cell: if it's unsafe (1), you lose 1 health immediately
  dist[0][0] = grid[0][0];

  // Directions for moving up, down, left, right
  const dirs = [
    [1, 0],
    [-1, 

Load Subscription Term Discount Price

<mvt:comment> 1. Build a discount state from the current basket </mvt:comment>
<mvt:do file="g.Module_Feature_PGR_UT" name="l.ok"
        value="DiscountState_CreateFromBasket( g.Basket, l.discount_state )" />
<mvt:do file="g.Module_Feature_PGR_UT" name="l.ok"
        value="DiscountState_Load_PriceGroups_Basket( g.Basket, l.discount_state )" />

<mvt:comment> 2. Predict the price for this product + subscription term
     args: discount_state, product, subterm_id, variant_id, quantity,
         

Caching via Redis

Snippet for caching via redis. This example is caching a Flex Component mega menu because it has many links and loading the categories & links takes valuable processing time
<mvt:assign name="l.cache_key"			value="tolower( slugify( g.Domain:name ) ) $ '-' $ tolower( slugify( g.Store:branch:name ) ) $ '-global_mega_menu'" />
<mvt:assign name="l.global_mega_menu"	value="''" />
<mvt:assign name="l.redis_connected"	value="0" />
<mvt:assign name="l.expiration"			value="2 * 60 * 60" />
<mvt:if expr="g.Store:cache_type EQ 'redis'">
	<mvt:do file="g.Module_Library_Crypto" name="l.redispwd" value="Decrypt_Payment_Password( g.Store:redispwd )" />
	<mvt:do file="g.Module

recovery ubuntu root acccess

Out of the box Ubuntu doesn't use a root password unless you set one yourself. Here's how to recover:

When you see the grub screen, hit 'e' to edit kernel arguments.

Find the line that starts with 'linux' and at the end of that line, add init=/bin/bash.

Hit F10 or ESC to boot the machine. You're now in single user mode but filesystems are mounted read-only. We'll fix that like this: mount -no remount,rw /

Next, change the root password using passwd root.

Last, reboot the machine and you sho

Order report

select {o:code} as 'Eazle Order Number', {o:bcordernumber} as 'BC Order Number', {o:sapordernumber} as 'SAP Order number', {os:code} as 'Status', {bu:companycode} as 'Company Code', {bu:uid} as 'SoldTo', {o:originalordercode} as 'Amended Order', convert(date,{o:creationtime}) as 'Order Creation date', convert(time,{o:creationtime}) as 'Order Creation time'
from {order as o join b2bunit as bu on {bu:pk} = {o:unit} join orderstatus as os on {os:pk} = {o:status}}
where {o:creationtime} >= '2026-05-

Missing BC data order

select {oe:entrynumber}, {oe:quantity}, {oe:baseprice}, {oe:totalprice}, {p:code}, {o:code}, {o:bcordernumber}, {o:deliverydate}, {bu:uid}, {ad:sapcustomerid}
from {orderentry as oe 
join product as p on {p:pk} = {oe:product} 
join order as o on {o:pk} = {oe:order} and {o:bcordernumber} is not null and {o:bcorderupdatedstreammessage} is null and {o:status} <> '8796096528475'
join b2bunit as bu on {bu:pk} = {o:unit}
join address as ad on {ad:owner} = {bu:pk} and {ad:sapaddressusage} = 'SHIPTO'} 

{% style %} vs {% stylesheet %}

## {% style %}

This tag creates an inline `<style>` block that allows dynamic updates in the theme editor. However, it’s not automatically scoped to the section—meaning the styles inside can affect the entire page unless you explicitly scope them using `section.id`.

## {% stylesheet %}

Unlike {% style %}, styles inside {% stylesheet %} are bundled into a single CSS file by Shopify and injected into the theme through the `{{ content_for_header }}` global Liquid object. This ensures that sectio

git commit

請檢視目前所有未提交的 Git 變更,包含 staged、unstaged、untracked files。

請不要修改程式碼,也不要執行 git commit。

請根據實際 diff 產出一份繁體中文說明,並提供一個繁體中文 Conventional Commits 格式的 commit message。

輸出格式:

變更摘要:
- 

主要異動:
- 

注意事項:
- 

Commit message:
```text
type(scope): summary
````

Commit body:

```text
- ...
- ...
```

Python libraries

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler, PolynomialFeatures
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.model_selection import cross_val_score, train_test_split

1967. Number of Strings That Appear as Substrings in Word

Given an array of strings patterns and a string word, return the number of strings in patterns that exist as a substring in word. A substring is a contiguous sequence of characters within a string.
/**
 * @param {string[]} patterns
 * @param {string} word
 * @return {number}
 */
var numOfStrings = function(patterns, word) {
    let count = 0;

    for (const p of patterns) {
        // JS built-in substring check
        if (word.includes(p)) {
            count++;
        }
    }

    return count;
};

redirect apps change password

FSP_AFTER_LOGIN_URL

https://vinish.dev/oracle-apex-after-login-redirect-page#google_vignette

DECLARE
    l_URL VARCHAR2(4000);
    
BEGIN
    apex_util.set_session_state('G_APP_TFA_AUTH_CHECK', 'FALSE'); -- jm: check if this goes inside through 2fa, initially set as false

    -- IF nvl(:G_REQUIRE_MFA,'1') = '0' THEN -- *** JUST FOR NOW LOA TESTING JM 07-11-2025 --> i switched from 1=1 THEN --
    IF nvl(:G_REQUIRE_MFA,'1') = '0' THEN
        -- If the user does not use MFA, after authenticati

ヘッダー スクロールで表示/非表示

<header class="l-header js-l-header" data-is-scroll="false">
</header>

1846. Maximum Element After Decreasing and Rearranging

You are given an array of positive integers arr. Perform some operations (possibly none) on arr so that it satisfies these conditions: The value of the first element in arr must be 1. The absolute difference between any 2 adjacent elements must be less than or equal to 1. In other words, abs(arr[i] - arr[i - 1]) <= 1 for each i where 1 <= i < arr.length (0-indexed). abs(x) is the absolute value of x. There are 2 types of operations that you can perform any number of times: Decrease the value of any element of arr to a smaller positive integer. Rearrange the elements of arr to be in any order. Return the maximum possible value of an element in arr after performing the operations to satisfy the conditions.
/**
 * @param {number[]} arr
 * @return {number}
 */
var maximumElementAfterDecrementingAndRearranging = function(arr) {
    arr.sort((a, b) => a - b);

    // First element must be 1
    arr[0] = 1;

    for (let i = 1; i < arr.length; i++) {
        // Each element can be at most previous + 1
        arr[i] = Math.min(arr[i], arr[i - 1] + 1);
    }

    return arr[arr.length - 1];
};

lm-studio-new

sk-lm-QXIxK2Gb:cmVOV9XcoMR9IQNwkto5

3020. Find the Maximum Number of Elements in Subset

You are given an array of positive integers nums. You need to select a subset of nums which satisfies the following condition: You can place the selected elements in a 0-indexed array such that it follows the pattern: [x, x2, x4, ..., xk/2, xk, xk/2, ..., x4, x2, x] (Note that k can be be any non-negative power of 2). For example, [2, 4, 16, 4, 2] and [3, 9, 3] follow the pattern while [2, 4, 8, 4, 2] does not. Return the maximum number of elements in a subset that satisfies these conditions.
/**
 * @param {number[]} nums
 * @return {number}
 */
var maximumLength = function(nums) {
    const freq = new Map();
    let maxNum = 0;
    for (const num of nums) {
        freq.set(num, (freq.get(num) || 0) + 1);
        if (num > maxNum) maxNum = num;
    }

    // Base answer: either 1, or best odd count of 1's
    let ans = freq.has(1) ? freq.get(1) - (freq.get(1) % 2 === 0 ? 1 : 0) : 1;

    for (const num of nums) {
        if (num === 1) continue;

        let length = 0;
        let 

3739. Count Subarrays With Majority Element II

You are given an integer array nums and an integer target. Return the number of subarrays of nums in which target is the majority element. The majority element of a subarray is the element that appears strictly more than half of the times in that subarray.
/**
 * @param {number[]} nums
 * @param {number} target
 * @return {number}
 */
var countMajoritySubarrays = function(nums, target) {
    const n = nums.length;

    // Step 1: Convert to +1 / -1
    const arr = nums.map(x => x === target ? 1 : -1);

    // Step 2: Build prefix sums
    const pref = new Array(n + 1);
    pref[0] = 0;
    for (let i = 1; i <= n; i++) {
        pref[i] = pref[i - 1] + arr[i - 1];
    }

    // Step 3: Coordinate compression
    const sorted = [...pref].sort((a, b)